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 |
为什么WA?哪位牛人可不可以弄个数据看看啊#include <stdio.h> #include <string.h> #define Max 100 void main() { int s[26]; int i,k,l,N,count; char str[Max],str1[Max]; scanf("%d",&N); for(k=0;k<N;k++) { for(i=0;i<26;i++) s[i]=0; fflush(stdin); gets(str); if(strcmp(str," ")!=0) for(i=0;i<strlen(str);i++) { l=str[i]-'a'; s[l]++; } gets(str1); if(strcmp(str1," ")!=0) for(i=0;i<strlen(str1);i++) { l=str1[i]-'a'; s[l]--; } count=0; for(i=0;i<26;i++) { if(s[i]<0) { s[i]=-s[i]; } count+=s[i]; } printf("Case #%d: %d\n",k+1,count); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator