我有以下代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
string a;
string b;
cin>>a;
cin>>b;
vector<char> v1(a.begin(),a.end());
vector<char> v2(b.begin(),b.end());
sort(v1.begin(),v1.end());
sort(v2.begin(),v2.end());
vector<char> c;
auto ls = set_intersection(v1.begin(),v1.end(),v2.begin(),v2.end(),c.begin());
cout<<"hello"<<endl;
cout<<ls-c.begin()<<endl;
cout<<c.size()<<endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
在 set_intersection 线之后没有打印任何内容,甚至没有与相交线无关的“hello”,为什么?