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

1298为什么wrong answer???求高手指导

Posted by Archer_wu at 2012-05-19 00:43:46 on Problem 1298
#include <iostream>
#include <string>
using namespace std;

void jiemi(string s)
{
     for(int i=0;i<=s.size();i++)
     { 
       if('A'<=s[i]&&s[i]<='E')
          cout<<char(s[i]+21);
        else if('F'<=s[i]&&s[i]<='Z')
               cout<<char(s[i]-5);
         else cout<<s[i];
					}
     }
int main()
{
   string str; 
   while(cin>>str)
   {
    if(str=="ENDOFINPUT")
     break;
    if(str=="START")
    {
      char enter=cin.get();
      getline(cin,str);
      jiemi(str);
    }
   }
   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