Run ID:26857
提交时间:2022-05-24 17:14:24
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { int i; char str[100]="China"; char newstr[100]={0}; for(i=0;i<strlen(str);i++) { if('a'<=str[i] && str[i]<='z') newstr[i] = (char)(((int)(str[i])-97+4)%26+97); else newstr[i] = (char)(((int)(str[i])-65+4)%26+65); } cout<<newstr<<endl; return 0; }