题目链接:http://codeup.cn/problem.php?cid=100000569&pid=3
#include<bits/stdc++.h>
using namespace std;
int main()
{
char cipherText[10000];
scanf("%s", cipherText);
int len = sizeof(cipherText);
for(int i=0; i<len; i++) {
if('A' <= cipherText[i] && cipherText[i] <= 'Z') {
cipherText[i] = 'A' + 'Z' - cipherText[i];
}
if('a' <= cipherText[i] && cipherText[i] <= 'z') {
cipherText[i] = 'a' + 'z' - cipherText[i];
}
}
printf("%s\n", cipherText);
return 0;
}
运行结果