Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:各位高手,请帮我看看是什么错!代码如下!In Reply To:各位高手,请帮我看看是什么错!代码如下! Posted by:dingdongsheng at 2008-08-14 22:46:16 #include<cstdio> #include<iostream> #include<cstring> using namespace std; int main() { char a[100]; int i; while(gets(a) && strcmp(a,"#")) { int lnth = strlen(a); for(i = 0;i < lnth;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"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator