| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:怎么可能错呢?~~~~~~~~~~~~~~~~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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator