#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
string pas;
cin >> n >> pas;
string pas1 = "abcdefghijklmnopqrstuvwsyz";
for(int i=0; i<pas.size(); ++i){
if(pas[i]+n <= 122){
char t = pas[i]+n;
cout << t;
}else{
int res = (pas[i]+n) % 123;
char t1 = pas1[res];
cout << t1;
}
}
return 0;
}
系统提示报错为这个
26
qwertyuiopasdfghjklzxcvbnm
输出为:qwertyuiopasdfghjklzxcvbnm
我测试输出为 qwertyuiopasdfghjklzxcvbnm
有点疑惑