Falcone @ 2023-09-06 16:46:34
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int n,l=0;
cin >> n;
string str1;
cin >> str1;
l = size(str1);
for (int i = 0; i<=l-1;i++)
{
str1[i] += n;
if (str1[i] > 'z')
{
int t = (int)str1[i]-122;
str1[i] = (t % 26) + 'a'-1;
}
}
cout << str1;
return 0;
}
by dthythxth_Huge_Brain @ 2023-09-06 17:02:41
@Falcone 是
by dthythxth_Huge_Brain @ 2023-09-06 17:03:31
@Falcone 但貌似 c++20 是可以编译的。。。
by Falcone @ 2023-09-25 15:55:27
@Huge_Brain 学到了,谢谢~