Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

可以更短嘛?

Posted by KatrineYang at 2016-07-29 17:40:03 on Problem 1298 and last updated at 2016-07-29 17:41:53
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator