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 conan614 at 2009-10-31 20:29:44 on Problem 1298
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string start;//开始
	string end;//结束
	string middle;//输入字符串
	while(1)
	{
	 cin>>start;
	 if(start=="ENDOFINPUT")
	    break;
	 cin.ignore();
	 getline(cin,middle);//可以接受空格的字符串输入方法
	 cin>>end;
	 for(int i=0;i<middle.length();i++)
	  {
	    if((int)middle[i]>=65&&(int)middle[i]<=90)
	    cout<<(char)((((int)middle[i]-65)+21)%26+65);//减5相当于加了21
	    else
	    cout<<middle[i];
	  }
	    cout<<endl;
	}
}

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