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 |
为什么wrong啊!求救中.....#include<stdio.h> int b[100],c[100]; void fun(char *s,int *w) { int i=0,j=0; for(i=0;i<sizeof(s);i++) for(j=i;j<sizeof(s);j++) if(s[i]==s[j]) w[i]++; } int main() { int m,n,t; char a[100]; scanf("%s",a); fun(a,b); for(m=0;m<sizeof(a);m++) for(n=m;n<sizeof(a);n++) if(b[n]>b[m]){t=b[n],b[n]=b[m];b[m]=t;} scanf("%s",a); fun(a,c); m=n=0; for(m=0;m<sizeof(a);m++) for(n=m;n<sizeof(a);n++) if(c[n]>c[m]){t=c[n],c[n]=c[m];c[m]=t;} for(m=0;m<sizeof(a);m++) { if(b[m]!=c[m]){printf("NO");return 0;} else {printf("YES");return 0;} } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator