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 |
这道题充分显示了C++对C的优越性!!!#include <iostream> #include <string> using namespace std; int main() { string str; int i, n; while(getline(cin, str), str != "ENDOFINPUT") { getline(cin, str); n = str.length(); for(i = 0; i < n; ++i) { if(str[i] >= 'A' && str[i] <= 'Z') { str[i] -= 5; if(str[i] < 'A') str[i] += 26; } } cout << str << endl; getline(cin, str); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator