yonglooksanlivi @ 2024-04-03 22:15:08
源代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
int n;
cin>>n;
cin>>a;
for(int i=0;i<a.length();i++)
{
if(a[i]>='a' && a[i]<='z')
{
a[i]=a[i]+(char)n;
if(a[i]>'z')
a[i]=a[i]%122+96;
}
}
for(int i=0;i<a.length();i++)
cout<<a[i];
return 0;
}
by zcy30 @ 2024-09-28 22:50:18
a[i]=a[i]%122+96;这行不对改成 a[i]=a[i]-26