| ||||||||||
| 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:A不出来,谁可以让我看看他的呀In Reply To:A不出来,谁可以让我看看他的呀 Posted by:lijianac at 2008-03-07 17:35:16 #include <iostream>
#include <string>
using namespace std;
string shift(string str){
int i;
for (i=0;i<str.length();i++){
if (str[i]>='A'&&str[i]<='Z') str[i]=(str[i]-'A'+21)%26+'A';
}
return str;
}
int main(){
string temp,ans[1000];
int flag=0;
int i,j;
for (i=0; ;i++){
for (j=0; ;j++){
cin>>temp;
if (temp=="START") continue;
else if (temp=="END") break;
else if (temp=="ENDOFINPUT"){
flag=1;
break;
}
else ans[i]=ans[i]+shift(temp)+" ";
}
if (flag==1) break;
}
for (j=0;j<i;j++) cout<<ans[j]<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator