1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| #include <cstdio> #include <cstring> #include <cmath> #include <iostream> #include <iomanip> #include <set> #include <queue> #include <stack> #include <vector> #include <string> #include <sstream> #include <bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;++i) #define per(i,a,n) for(int i=n-1;i>=a;--i); #define ms(x,a) memset((x),a,sizeof((x))) #define INF 0x3f3f3f3f #define eps 1e-8 #define fi first #define e 2.718281828459045235360287471352662497757247093699959574966967627724076630353 #define se second #define mp make_pair #define pb push_back #define np next_permutation #define gapline cout<<"##======================##"<<endl using namespace std; const int maxn=1e5+5; const int maxl=26; const int maxm=1e5+5;
string s; set<string> ans; map<string,int> mmp; int main(){ ios::sync_with_stdio(false); while(cin>>s&&s[0]!='#'){ ans.insert(s); string temp=s; rep(i,0,temp.length()){ if(isupper(temp[i])) temp[i]=temp[i]-'A'+'a'; } sort(temp.begin(),temp.end()); mmp[temp]++; } set<string>::iterator it; for(it=ans.begin();it!=ans.end();it++){ string temp=*it; rep(i,0,temp.length()){ if(isupper(temp[i])) temp[i]=temp[i]-'A'+'a'; } sort(temp.begin(),temp.end()); if(mmp[temp]==1) cout<<*it<<endl; } }
|