0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-27 07:31:58 +00:00
OI-codes/Luogu/problem/P1200/solution.md
2021-01-02 15:30:52 +08:00

43 lines
671 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 思路
按照题意计算即可。
## 代码
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int us = 1, zs = 1;
string a, b;
getline(cin, a);
getline(cin, b);
for (int i = 0; i < 7; i++) {
if (a[i] <= 0) break;
else us *= a[i] - 64;
}
for (int i = 0; i < 7; i++) {
if (b[i] <= 0) break;
else zs *= b[i] - '@';
}
us %= 47;
zs %= 47;
if (us == zs) cout << "GO" << endl;
else cout << "STAY" << endl;
return 0;
}
```
## 后记
- Update12019-07-10
无说明。
- Update22020-10-12
- 优化代码
- 弃用不安全的 `gets` 函数。