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

此等水题为啥要16ms,附代码,求大牛解释一下

Posted by lzq08ms at 2011-05-17 22:36:05 on Problem 2141
#include <stdio.h>
#include <string.h>

int main()
{
	char map[28] , s[100] ;
	int i ;
	scanf("%s",map) ;
	getchar() ;
	gets(s) ;
	for( i = 0 ; i < strlen(s) ; i++ )
	{
		if(s[i]>='A'&&s[i]<='Z') {
			s[i]+=32 ;
			printf("%c",map[s[i]-'a']-32) ;
		}
		else if(s[i]>='a'&&s[i]<='z') printf("%c",map[s[i]-'a']) ;
		else printf("%c",s[i]) ;
	}
	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