We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bb35cd commit 22f968cCopy full SHA for 22f968c
06xxx/06890.cpp
@@ -0,0 +1,32 @@
1
+#include <iostream>
2
+#include <string>
3
+using namespace std;
4
+
5
+inline int c2i(char c) { return c - 'A'; }
6
+inline char i2c(int i) { return i + 'A'; }
7
8
+inline char calc(char a, char b) {
9
+ return i2c((c2i(a) + c2i(b)) % 26);
10
+}
11
12
+void solve(void) {
13
+ string a; getline(cin, a);
14
+ string b; getline(cin, b);
15
16
+ for (int i=0; i<b.length(); i++) {
17
+ if ('A' <= b[i] && b[i] <= 'Z') continue;
18
+ b.erase(i--, 1);
19
+ }
20
21
22
+ cout << calc(b[i], a[i % a.length()]);
23
24
25
26
+int main(void) {
27
+ ios::sync_with_stdio(false);
28
+ cin.tie(nullptr);
29
30
+ solve();
31
+ return 0;
32
0 commit comments