题解 | 斗兽棋

斗兽棋

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

#include <iostream>
using namespace std;

int main() {
    string str1,str2;
    cin>>str1>>str2;
    if(str1=="elephant"&&str2=="tiger"||
    str1=="tiger"&&str2=="cat"||
    str1=="cat"&&str2=="mouse"||
    str1=="mouse"&&str2=="elephant"){
        cout<<"win";
        return 0;
    }
    if(str2=="elephant"&&str1=="tiger"||
    str2=="tiger"&&str1=="cat"||
    str2=="cat"&&str1=="mouse"||
    str2=="mouse"&&str1=="elephant"){
        cout<<"lose";
        return 0;
    }
    else{
        cout<<"tie";
        return 0;
    }



}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

02-26 09:15
已编辑
蚌埠学院 golang
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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