0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 13:38:47 +00:00
OI-codes/Luogu/P1079/P1079.cpp

20 lines
363 B
C++
Raw Normal View History

2020-11-01 07:54:30 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
string k, c;
2021-11-19 09:01:13 +00:00
int t = 0;
2020-11-01 07:54:30 +00:00
cin >> k >> c;
for (int i = 0; i < c.size(); i++) {
t = (k[i % k.size()] & 31) - 1;
2021-11-19 09:01:13 +00:00
if ((c[i] & 31) - t > 0) {
2020-11-01 07:54:30 +00:00
c[i] = c[i] - t;
2021-11-19 09:01:13 +00:00
} else {
2020-11-01 07:54:30 +00:00
c[i] = c[i] - t + 26;
}
}
cout << c << endl;
return 0;
}