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<algorithm> #include<iostream> #include<cstring> #include<cstdio> using namespace std; char a[200],b[200]; int c[30],d[30]; int main(){ while(~scanf("%s\n%s",a,b)){ int l=strlen(a); memset(c,0,sizeof(c)); memset(d,0,sizeof(d)); for(int i=0;i<l;++i){ c[a[i]-'A']++; d[b[i]-'A']++; } sort(c,c+26); sort(d,d+26); bool yes=1; for(int i=0;i<26;++i){ if(c[i]!=d[i]){ yes=0; break; } } if(yes==1) puts("YES"); else puts("NO"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator