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 |
可以更短嘛?#include <iostream> #include <string> using namespace std; int main() { string s; while(1){ getline(cin,s); if(s=="ENDOFINPUT")break; getline(cin,s); for(int i=0;i<s.length();i++){ if(s[i]<'A'||s[i]>'Z'){ cout<<s[i]; } else{ cout<<(char)('A'+(s[i]-'A'+21)%26); } } cout<<endl; getline(cin,s); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator