0%

[題解]ROT13

a067. ROT13

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <bits/stdc++.h>
#define ld long double
using namespace std;

int main(){
string s;
getline(cin,s);
for(auto p:s){
if(isalpha(p)){
if(isupper(p))
cout<<(char)((p-'A'+13)%26+'A');
else
cout<<(char)((p-'a'+13)%26+'a');
}
else{
cout<<p;
}
}
}