HDU 1048 The Hardest Problem Ever

 

求密码字符串,很简单

跟着题目走,直接上代码

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     char st[15],en[15],pas[1005];
 9     while(~scanf("%s",st),strcmp("ENDOFINPUT",st)){
10             getchar();
11         gets(pas);
12         for(int i=0;i<strlen(pas);i++){
13             if(pas[i]<'A'||pas[i]>'Z')
14                 continue;
15             if(pas[i]>'E')
16                 pas[i]=pas[i]-'F'+'A';
17             else
18                 pas[i]=pas[i]+'V'-'A';
19         }
20 
21         scanf("%s",en);
22         printf("%s\n",pas);
23     }
24     return 0;
25 }

 

posted @ 2016-01-24 19:45  闪耀子  阅读(143)  评论(0编辑  收藏  举报