数论没学好,求余写得太复杂
include
using namespace std;
int main(){
int t;
cin>>t;
getchar();
for (int i=0; i<t; i++) {
string str;
string key;
string answer;
getline(cin, str);
//cout<<str<<endl;
getline(cin, key);
//cout<<key<<endl;
int flag=0;
for (int j=0; j<str.size(); j++) {
if (str[j]==’ ‘) {
answer.insert(j, ” “);
}else{
string temp;
temp=(str[j]+(key[flag%key.size()]-‘A’)-‘A’)%26+’A’;
//cout<<temp;
answer.insert(j, temp);
flag++;
}
}
cout<<”case #”<<i<<”:”<<endl;
cout<<answer<<endl;
}
return 0;
}
呜呜呜 冷淠太强了 追不上辽TAT