您的位置:首页 > 其它

POJ 1298 解题报告

2014-11-30 09:15 281 查看
这道题就是按照题目要求实现的。

1298Accepted688K0MSG++898B
/*
ID: thestor1
LANG: C++
TASK: poj1298
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <limits>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cassert>

using namespace std;

int main()
{
std::ios::sync_with_stdio(false);
string start, line, end;
while (getline(cin, start) && start == "START")
{
getline(cin, line);
getline(cin, end);
// cin >> end;
// cout << "end:" << end << endl;
assert (end == "END");
for (int i = 0; i < line.size(); ++i)
{
if (line[i] >= 'A' && line[i] <= 'Z')
{
cout << (char)('A' + ((line[i] - 'A' + 26 - 5) % 26));
}
else
{
cout << line[i];
}
}
cout << endl;
}
assert (start == "ENDOFINPUT");

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: