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

大牛们帮忙看一下这个程序为什么wa

Posted by boringcpu at 2010-04-16 07:56:06 on Problem 2538
#include<stdio.h>
#include<string.h>
int main()
{
	int i,j;
	char str[300];
	char str1[]="`1234567890-=";
	char str2[]="QWERTYUIOP[]\\";
	char str3[]="ASDFGHJKL;'";
	char str4[]="ZXCVBNM,./";
    while(gets(str)!=NULL)
	{
		for(i=0;i<strlen(str);i++)
		{
			if(str[i]==' ')
				printf(" ");
			for(j=0;j<13;j++)
			{
				if(str[i]==str1[j])
					printf("%c",str1[j-1]);
				else if(str[i]==str2[j])
					printf("%c",str2[j-1]);
				else if(str[i]==str3[j])
					printf("%c",str3[j-1]);
				else if(str[i]==str4[j])
					printf("%c",str4[j-1]);
			}
		}
		printf("\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