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

我无语了!

Posted by chenxuan123456789 at 2012-08-04 19:04:30 on Problem 2141
#include <stdio.h>
#include <string.h>
int main()
{
	char hash[30];
	char str[100];
	int i,length;
	  scanf("%s",hash);
	  getchar();
	   gets(str);
		length=strlen(str);
	for(i=0;i<length;i++)
	{
		if(str[i]>='A'&&str[i]<='Z')
		{
		str[i]+=32;
		printf("%c",hash[str[i]-'a']-32);
		}
		else
		if(str[i]>='a'&&str[i]<='z')
		{
			str[i]=hash[str[i]-'a'];
			printf("%c",str[i]);
		}
		else
		printf("%c",str[i]);
	}
	printf("\n");
	return 1;
}

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