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

cin.ignore()你有写嘛

Posted by codingman at 2011-10-02 22:05:13 on Problem 3749
#include <iostream>
#include<fstream>
#include<string>
using namespace std;
 
int main (int argc,char **argv)
{
/*	fstream cin(argv[1]);*/
   string mima;
   string symbol;
   string end;
   int strlen;
   int i;
   while(cin>>symbol)
   {
	   if (symbol.compare("ENDOFINPUT")==0)
	     break;
     cin.ignore();
	   getline(cin,mima);
/*	   cout<<mima<<"   ***"<<endl;*/
	   cin>>end;
          
	   strlen=mima.length();
	   for(i=0; i < strlen; i++)
	   {
		   if((mima[i]>='A')&&(mima[i]<='Z'))
			   mima[i]='Z'-('Z'-mima[i]+5)%26;
	   }
cout<<mima<<endl;

   }
/*	cin.close;*/
	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