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

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

Posted by kimhmguen at 2010-03-22 02:31:28 on Problem 2538
#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