题解 | 斗兽棋

斗兽棋

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

#include <iostream>
using namespace std;

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

    
}

全部评论

相关推荐

09-29 12:24
门头沟学院 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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