Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string s,c;
- vector<string>v1;
- map<string,int>mp;
- while(cin>>s){
- v1.push_back(s);
- mp[s]++;
- }
- for(long int i=0;i<v1.size();i++)
- {
- for(long int j=0;j<v1.size();j++)
- {
- c= v1[i]+v1[j];
- if(mp[c]!=0) {
- cout<<c<<endl;
- mp[c]=0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement