getline对一行的输入
简单密码
http://www.nowcoder.com/questionTerminal/ff99c43dd07f4e95a8f2f5448da3772a
include
include
include
using namespace std;
int main(){
string str;
while(getline(cin,str)){//起始行
if(str=="ENDOFINPUT")
break;
getline(cin,str);//密文
for(int i=0;i<str.size();++i){
if(str[i]>='A'&&str[i]<='Z')
str[i]='A'+(21+str[i]-'A')%26;//对26循环取余
}
cout<<str<<endl;
getline(cin,str);//结束行
}
return 0;
}