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 xiaxia at 2006-04-09 16:06:38 on Problem 1298
In Reply To:这道菜题怎么wa了,一遇到getline就晕阿,菜题没切成被菜切了 Posted by:first at 2006-04-08 23:12:04
> #include <iostream>
> #include <iomanip>
> #include <cmath>
> #include <string>
> using namespace std;
> 
> string input;
> int  main()
> {
>     while(cin >> input &&  input !=  "ENDOFINPUT")
> 	{
> 		getline(cin, input);
> 		int i, k;
> 		for(i =  0; i < input.length(); i ++)
> 		{
> 			if(input[i] >= 'A' && input[i] <= 'Z')
> 			{
>                  k = input[i] - 'A';
> 				 k = ((k - 5) + 26)%26;
> 				 input[i] = 'A' + k;
> 			}
> 		}
> 		cout << input << endl;
>         cin >> input;
> 	}  
> 	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