zlh202483023 @ 2024-12-12 20:15:03
#include<iostream>
using namespace std;
void change(char str[50],int n);
int main() {
char str[100];
int n;
cin >> n;
cin.ignore();
cin.getline(str, 50);
change(str, n);
cout << str;
return 0;
}
void change(char str[50], int n) {
int i;
for (i = 0; str[i] != '\0'; i++) {
str[i] = str[i] + n;
}
}
by EASONWHT @ 2024-12-21 21:15:23
支持互关^_^:
#include<bits/stdc++.h>
using namespace std;
int main(){
string a;
int b;
cin>>b>>a;
for(int i=0;i<a.size();++i){
for(int j=1;j<=b;++j){
++a[i];
if(a[i]>'z')a[i]='a';
}
}
cout<<a<<endl;
return 0;
}
@zlh202483023