351681578wdp @ 2019-04-23 23:56:20
int main() { int num; std::cin >> num; char a[50]; std::cin.get(); gets_s(a); for (int i = 0; i < strlen(a); i++) {
std::cout <<char( (a[i]-'a'+num)%26+'a');
}
return 0;
}
by liuzitong @ 2019-04-24 07:58:04
因为WA==wonderful answer (完美的答案)
by SparrowHe @ 2019-04-24 10:17:05
@liuzitong
WA ==
by zhangqingbin125 @ 2019-04-25 15:52:05
using namespace std;
int main()
{
int a;
cin>>a;
string b;
cin>>b;
int len=b.length();
for(int i=0;i<len;i++)
{
cout<<char((b[i]-'a'+a)%26+'a');
}
cout<<endl;
return 0;
}
by 大船靠岸 @ 2019-05-22 19:02:19
希望更丰富的展现?使用Markdown
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <iostream>
int main() {
int num;
std::cin >> num;
char a[50];
std::cin.get();
gets_s(a);
for (int i = 0; i < strlen(a); i++) {
std::cout << char((a[i] - 'a' + num) % 26 + 'a');
}
return 0;
}