算法
(模拟) $O(1)$
直接模拟即可。
C++ 代码
#include <bits/stdc++.h>
using std::cin;
using std::cout;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a == b) cout << c << '\n';
else if (a == c) cout << b << '\n';
else if (b == c) cout << a << '\n';
else cout << 0 << '\n';
return 0;
}
// 更简洁的写法
#include <bits/stdc++.h>
using std::cin;
using std::cout;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a != b and b != c and a != c) puts("0");
else cout << (a ^ b ^ c) << '\n';
return 0;
}