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 |
why wa??#include<stdio.h> #include<string.h> int s1[27]={0}; int s2[27]={0}; int main() { char a[101],b[101]; int i,j,flag,len; scanf("%s%s",a,b); len=strlen(a); int count1=0,count2=0; for(i=0;i<26;i++) { s1[i]=0; s2[i]=0; } for(i=0;i<len;i++) { s1[a[i]-'A']++; s2[b[i]-'B']++; } // int count=0; for(i=0;i<26;i++) { flag=0; for(j=0;j<26;j++) { if(s1[i]==s2[j]) { flag=1; break; } } if(flag==0) break; } if(i==26) printf("YES\n"); else printf("NO\n"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator