Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
瞎折腾#include <iostream> using namespace std; int cmp(const void *a,const void *b) { return (*(int *)a-*(int *)b); } int main() { char a[101]={100},b[101]={100};// int count,count1[26]={0},count2[26]={0}; int i,len; cin>>a>>b; len=strlen(a); for(i=0;i<len;i++){ count1[a[i]-'A']++; count2[b[i]-'A']++; } qsort(count1,26,sizeof(int),cmp); qsort(count2,26,sizeof(int),cmp); for(i=0;i<26;i++) if(count1[i]!=count2[i])break; if(i==26)cout<<"YES"<<endl; else cout<<"NO"<<endl; // system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator