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

Re:怎么可能错呢?~~~~~~~~~~~~~~~~

Posted by CD at 2005-03-08 13:08:45 on Problem 1298
In Reply To:怎么可能错呢?~~~~~~~~~~~~~~~~ Posted by:ale at 2004-04-07 21:34:14
把CODE[i]<64改为code[i]<65就行了……


> #include<iostream>
> #include<string>
> using namespace std;
> 
> int main()
> {
>    string code;
>    while(cin){
>       getline(cin, code);
>       if(code == "ENDOFINPUT") return 0;
>       if(code != "START") return 1;
>       getline(cin, code);      
>       for(int i = 0; i < code.size(); i++){
>          if(code[i] < 64 || code[i] > 90) cout << code[i];
>          else cout << (char)((code[i] - 5 - 65 + 26) % 26 + 65);
>       }
>       cout << endl;
>       getline(cin, code);
>       if(code != "END") return 1;
>    }
> }  

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