题解 | 斗兽棋
斗兽棋
https://www.nowcoder.com/practice/0b5afb815f6848d9a7f9c1b0ce514b95
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main() {
string a,b;
cin >> a >> b;
map<string,string> rules = {{"elephant","tiger"},{"tiger","cat"},{"cat","mouse"},{"mouse","elephant"}};
if(rules[a]==b)
{
cout << "win" << endl;
}
else if(rules[b]==a)
{
cout << "lose" << endl;
}
else {
cout << "tie" << endl;
}
return 0;
}
OPPO公司福利 1225人发布