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> #include<stdlib.h> #include <cstdlib> #include<algorithm> using namespace std; int main() { char s[100],t[100],l[100]; int i,k; scanf("%s%s",s,t); k=strlen(s); for(i=0;i<k;i++) if(s[i]=='A') l[i]='Z'; else l[i]=s[i]-1; l[i]='\0'; sort(t,t+k); sort(l,l+k); for(i=0;i<k;i) if(t[i]==l[i++]); else break; if(i=k) printf("YES\n"); else printf("NO\n"); system("pause"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator