题解 | 斗兽棋

斗兽棋

https://www.nowcoder.com/practice/0b5afb815f6848d9a7f9c1b0ce514b95

#include<bits/stdc++.h>
using namespace std;

string s1,s2;

int main(){
	cin>>s1>>s2;
	
	if(s1=="elephant"&&s2=="tiger"||s1=="tiger"&&s2=="cat"||s1=="cat"&&s2=="mouse"||s1=="mouse"&&s2=="elephant"){
		cout<<"win"<<endl;
	}else if(s2=="elephant"&&s1=="tiger"||s2=="tiger"&&s1=="cat"||s2=="cat"&&s1=="mouse"||s2=="mouse"&&s1=="elephant"){
		cout<<"lose"<<endl;
	}else{
		cout<<"tie"<<endl;
	}

    return 0;
}


全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务