HDU/HDOJ 1048 The Hardest Problem Ever

题目传送门:

http://acm.hdu.edu.cn/showproblem.php?pid=1048

水题~~~
标题党~~~

AC代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <string>
using namespace std;
 
string cipher, ss;
 
int main()
{
    //freopen("input.txt", "r", stdin);
    while(cin >> ss)
    {
        if(ss == "ENDOFINPUT")
            break;
        getchar();
        getline(cin, cipher);
        for(size_t i=0; i<cipher.size(); ++i)
        {
            if('F'<=cipher[i] && cipher[i]<='Z')
                cipher[i] -= 5;
            else if('A'<=cipher[i] && cipher[i]<='E')
                cipher[i] += 21;
        }
        cout << cipher << endl;
        cin >> ss;
    }
    return 0;
}

发布者

Tanky Woo

Tanky Woo,[个人主页:https://tankywoo.com] / [新博客:https://blog.tankywoo.com]

发表评论

电子邮件地址不会被公开。 必填项已用*标注