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

Re:也可以更精练一些,嘻嘻,这样打表ok~ 一开始 " ` " 弄错了 wa了两次,555

Posted by happyness at 2010-07-22 10:35:02 on Problem 2538
In Reply To:也可以更精练一些,嘻嘻,这样打表ok~ 一开始 " ` " 弄错了 wa了两次,555 Posted by:kimhmguen at 2010-03-22 02:31:28
> #include<stdio.h>
> #include<string.h>
> char map[60]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
> int main()
> {
> 	char in[100];
> 	void f(char x);
> 	int i;
> 	while(gets(in)!=NULL)
> 	{
> 		for(i=0;i<strlen(in);i++)
> 		{
> 			f(in[i]);
> 		}
> 		printf("\n");
> 	}
> 	return 0;
> }
> void f(char x)
> {
> 	int i;
> 	if(x==' ')
> 	{
> 		printf(" ");
> 		return;
> 	}
> 	for(i=0;i<60;i++)
> 	{
> 		if(x==map[i])
> 		{
> 			printf("%c",map[i-1]);
> 			break;
> 		}
> 	}
> }

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