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:各位高手,请帮我看看是什么错!代码如下!

Posted by wujiazhao88 at 2009-03-19 00:32:33 on Problem 3650
In Reply To:各位高手,请帮我看看是什么错!代码如下! Posted by:dingdongsheng at 2008-08-14 22:46:22
> #include<stdio.h>
> #include<string.h>
> void main()
> {
>     char a[100];
> 	int i;
> 	while(gets(a),strcmp(a,"#"))
> 	{
> 		for(i=0;a[i]!='\0';i++)
> 		{
> 			if(a[i]==' ')
> 				printf("%20");
> 			else if(a[i]=='!')
> 				printf("%21");
> 			else if(a[i]=='$')
> 				printf("%24");
> 			else if(a[i]=='%')
> 				printf("%25");
> 			else if(a[i]=='(')
> 				printf("%28");
> 			else if(a[i]==')')
> 				printf("%29");
> 			else if(a[i]=='*')
> 				printf("%2a");
> 			else
> 				printf("%c",a[i]);
> 		}
> 		printf("\n");
> 	}
> }
我用switch ,简单明了...made,居然把$搞成%21害WA4次,都怪测试中没有$$$$$$...

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