题解 | 斗兽棋

斗兽棋

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")

全部评论

相关推荐

找工作勤劳小蜜蜂:矛盾是没有实习,就是没实战经验,公司不想要,公司不要,你就没有实习,你就进入死循环,另外你的项目不是社会现在有大量岗位存在行业用的,云存储人员早就饱和。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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