Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这道菜题怎么wa了,一遇到getline就晕阿,菜题没切成被菜切了#include <iostream> #include <iomanip> #include <cmath> #include <string> using namespace std; string input; int main() { while(cin >> input && input != "ENDOFINPUT") { getline(cin, input); int i, k; for(i = 0; i < input.length(); i ++) { if(input[i] >= 'A' && input[i] <= 'Z') { k = input[i] - 'A'; k = ((k - 5) + 26)%26; input[i] = 'A' + k; } } cout << input << endl; cin >> input; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator