| ||||||||||
| 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 | |||||||||
帮忙看看2159 实在是找不到错误#include<stdio.h>
#include<string.h>
int main()
{
char a[100],b[100];
int i,j,f=0;
scanf("%s",a);
scanf("%s",b);
for(i=0;i<strlen(a);i++)
{
if(a[i]!='A')
a[i]-=1;
else a[i]='Z';
}
for(i=0;i<26;i++){
for(j=0;j<26;j++){
if(a[i]==b[j]){b[j]=-1;break;}
else if(j==25&&a[i]!=b[j]){f=-1;break;}
}
}
if(f!=0) printf("NO\n");
else printf("YES\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