标签:clu namespace size main set ring turn har logs
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; char str1[101],str2[101]; int set1[26],set2[26]; int main() { while(cin>>str1>>str2) { memset(set1,0,sizeof(set1)); memset(set2,0,sizeof(set2)); int flag=1; for(int i=0;str1[i];i++) set1[str1[i]-‘A‘]++; for(int i=0;str2[i];i++) set2[str2[i]-‘A‘]++; sort(set1,set1+26); sort(set2,set2+26); for(int i=0;i<26;i++) if(set1[i]!=set2[i]) { flag=0; break; } if(flag) puts("YES"); else puts("NO"); } return 0; }
标签:clu namespace size main set ring turn har logs
原文地址:http://www.cnblogs.com/Wangwanxiang/p/6415449.html