POJ3650纯备忘

来源:互联网 发布:电路图设计软件 编辑:程序博客网 时间:2024/05/16 18:26

http://poj.org/problem?id=3650

输出%这个东西备忘。以及gets()输出备忘。

#include<cstdio>#include<cstring>using namespace std;char a[100];int main(){    while(gets(a)&&a[0]!='#'){            char c='%';        for(int i=0;i<strlen(a);i++){            if(a[i]==' ')printf("%c20",c);            else if(a[i]=='!')printf("%c21",c);            else if(a[i]=='$')printf("%c24",c);            else if(a[i]=='%')printf("%c25",c);            else if(a[i]=='(')printf("%c28",c);            else if(a[i]==')')printf("%c29",c);            else if(a[i]=='*')printf("%c2a",c);            else printf("%c",a[i]);        }        printf("\n");    }}

原创粉丝点击