Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

【求助】2159,实在找不到错误了,题里也没限制要输入几组数据,各位大大帮帮忙哈!

Posted by allanlyy at 2005-04-18 23:51:26
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator