要想实现平局,只需让三人出拳的编号总和为 $3$ 的倍数即可。
#include <bits/stdc++.h> using std::cin; using std::cout; int main() { int x, y; cin >> x >> y; int ans = (6 - x - y) % 3; cout << ans << '\n'; return 0; }