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:why Presentation Error?

Posted by xiaoha at 2005-09-09 17:06:15 on Problem 2141
In Reply To:Re:why Presentation Error? Posted by:shunan at 2005-09-09 13:30:38
你的输入不能使这个程序结束
> 这是我的代码,麻烦看一下输出格式那里有错?我崩溃了!thx!!!
> #include<stdio.h>
> #include<string.h>
> char key[27],tran[81],tranto[81];
> int main()
> {
> 	int i,count=0,len;
> 	scanf("%s",key);
> 	while(1==scanf("%s",tran))
> 	{
> 		count++;
> 		len=strlen(tran);
> 		for(i=0;i<len;i++)
> 		{
> 			if(tran[i]>90)
> 			{
> 				tranto[i]=key[tran[i]-97];
> 			}
> 			else
> 			{
> 				tranto[i]=key[tran[i]-65];
> 				tranto[i]-=32;
> 			}
> 		}
> 		tranto[len]=0;
> 		if(count==1)
> 		{
> 			printf("%s",tranto);
> 		}
> 		else
> 		{
> 			printf(" %s",tranto);
> 		}
> 	}
> 	printf("\n");//°把这行去了,还是PE!啊
> 	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