| ||||||||||
| 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()
{
int i,len,j,time;
char str1[200],str2[200];
while(scanf("%s%s",str1,str2) == 2)
{
len = strlen(str2);
for(i = 0;i < len;i++)
{
if(str2[i] == 'Z')
str2[i] = 'A';
else
str2[i]++;
}
time = 0;
for(i = 0;i < len;i++)
{
for(j = 0;j < len;j++)
{
if(str1[j] == str2[i])
{
str1[j] = ' ';
time++;
break;
}
}
}
if(time == len)
printf("YES\n");
else
printf("NO\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