mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 15:16:28 +00:00
767. 信息加密
https://www.acwing.com/problem/content/submission/code_detail/6850682/
This commit is contained in:
parent
c4a4e8ba38
commit
b5061e2296
19
AcWing/767/767.cpp
Normal file
19
AcWing/767/767.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
string s;
|
||||
getline(cin, s);
|
||||
for (char c : s) {
|
||||
if ('A' <= c && c <= 'Z') {
|
||||
cout << char((c - 'A' + 1) % 26 + 'A');
|
||||
} else if ('a' <= c && c <= 'z') {
|
||||
cout << char((c - 'a' + 1) % 26 + 'a');
|
||||
} else {
|
||||
cout << c;
|
||||
}
|
||||
}
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user