hdu 1048 The Hardest Problem Ever(水题)

来源:互联网 发布:ssm项目管理系统源码 编辑:程序博客网 时间:2024/06/12 22:28
//hdu 1048 The Hardest Problem Ever(水题)/*题意:就是改变大写字母。解题:很水,字母根据这个公式改一下就行啦:s[i]=(s[i]-'A'+21)%26+'A';*/#include<iostream>#include<cstdio>#include<cstring>using namespace std;char s[400];int main(){    while(gets(s)!=NULL)    {        if(strcmp(s,"ENDOFINPUT")==0) break;        gets(s);        for(int i=0;i<strlen(s);i++)        {            if(s[i]>='A'&&s[i]<='Z')            {                s[i]=(s[i]-'A'+21)%26+'A';            }        }        puts(s);        gets(s);        if(strcmp(s,"END")==0) continue;    }    return 0;}

0 0