POJ 1298

简介: #include #include #include #include using namespace std; char str[210]; int main() { int i,j,k,T; char str0[10]; while(s...
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
using namespace std;
char str[210];
int main()
{
    int i,j,k,T;
    char str0[10];
    while(scanf("%s",str0),strcmp(str0,"ENDOFINPUT"))
    {
        getchar();
        memset(str0,0,sizeof(str0));
        memset(str,0,sizeof(str));
        while(gets(str),strcmp(str,"END"))
        {
            for(i=0;str[i]!='\0';i++)
            {
                if(isalpha(str[i]))
                {
                    int temp=(int)str[i]-5;
                    printf("%c",temp>64?temp:temp+26);
                }
                else
                    printf("%c",str[i]);
            }
            putchar('\n');//必须的,否则end不会显示PE 
            memset(str,0,sizeof(str));
        }
    }
    system("pause");
    return 0;
}
                    
                    

 

目录
相关文章
|
5月前
POJ-2245-Lotto
POJ-2245-Lotto
25 0
|
人工智能 算法 BI
poj 2192 Zipper
题目链接:http://poj.org/problem?id=2192 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18658   Accepted: 6651 Description Given ...
974 0
poj 3664
http://poj.org/problem?id=3664 进行两轮选举,第一轮选前n进入第二轮,第二轮选最高   #include #include using namespace std; struct vote { int a,b; int c; ...
731 0
|
算法 数据建模 机器学习/深度学习
poj-3094-quicksum
http://poj.org/problem?id=3094 很简单 #include #include using namespace std; int main() { string a; int sum=0; while(getline(cin...
575 0
|
机器学习/深度学习