using namespace std; int main(){ string x; int n,c; while(cin >> n >> x ){ for(int i=0;i<x.size();i++){ if(x[i]+n<='z'){ x[i]+=n; }else if(x[i]+n>'z'){ c=x[i]+n-'z'; x[i]='a'+c%26-1; } } cout << x << endl; } return 0; }
咱也不知道为啥,我感觉已经很全面了,有没有大佬给我看看