From b5061e2296a448878fd8974e6665fd923beff1c6 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Mon, 2 Aug 2021 21:33:56 +0800 Subject: [PATCH] =?UTF-8?q?767.=20=E4=BF=A1=E6=81=AF=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/6850682/ --- AcWing/767/767.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 AcWing/767/767.cpp diff --git a/AcWing/767/767.cpp b/AcWing/767/767.cpp new file mode 100644 index 00000000..e55a3905 --- /dev/null +++ b/AcWing/767/767.cpp @@ -0,0 +1,19 @@ +#include + +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; +}