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 getgoingcc at 2012-10-09 12:08:10 on Problem 3650
# include <stdio.h>
# include <string.h>

char buf[105];

/*
" " (space)	%20
"!" (exclamation point)	%21
"$" (dollar sign)	%24
"%" (percent sign)	%25
"(" (left parenthesis)	%28
")" (right parenthesis)	%29
"*" (asterisk)	%2a
*/

void p(char *s)
{
    printf("%s", s);
}

int main()
{
    int i;
    while (fgets(buf, 105, stdin), strcmp(buf, "#\n")!=0)
    {
        for (i = 0; buf[i]; ++i)
        {
            switch(buf[i])
            {
                case ' ': p("%20");break;
                case '!': p("%21");break;
                case '$': p("%24");break;
                case '%': p("%25");break;
                case '(': p("%28");break;
                case ')': p("%29");break;
                case '*': p("%2a");break;
                default: putchar(buf[i]);break;
            }
        }
    }

    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