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我?!!!!好不容易写了个简洁的程序,提供的那个测试数据也能通过,为什么却总是WA? #include<stdio.h> #include<stdlib.h> main() { char txt[100]={'\0'}; char cipher[100]={'\0'}; int i; int t[26]={0}, c[26]={0}; int flag=1; scanf("%s",&cipher); scanf("%s",&txt); for(i=0;txt[i]!='\0';++i) { if(txt[i]=='Z') txt[i]='A'; else txt[i]++; } for(i=0;txt[i]!='\0';++i) { t[txt[i]-65]++; c[cipher[i]-65]++; } for(i=0;i<26;i++) { if(t[i]!=c[i]) { printf("NO"); return 0; } } 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