首页
比赛
tracker
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
斗兽棋
59条解析
开通博客写题解
Silencer76
发表于 2025-06-10 13:39:31
题目链接 斗兽棋 题目描述 牛牛和牛妹在玩一个博弈游戏。每人从 elephant, tiger, cat, mouse 四种棋子中选择一个。 胜负规则形成一个循环克制链: elephant 吃 tiger tiger 吃 cat cat 吃 mouse mouse 吃 elephant 如果一方
展开全文
GB279824
发表于 2025-06-08 13:30:59
rules = { "elephant":"tiger", "tiger":"cat", "cat":"mouse", "mouse&qu
展开全文
在努力存钱的小松鼠很矫健
发表于 2025-08-13 11:37:11
#include <iostream> using namespace std; int main() { string s1,s2; cin>>s1>>s2; if (s2=="elephant"&&
展开全文
爱读书的菠萝蜜很想去杭州
发表于 2025-06-08 17:48:31
import re import sys bro,sis = input().split() ani_sor = ['elephant','tiger','cat','mouse'] bro_idx = ani_sor.index(bro) sis_idx = ani_sor.index(sis)
展开全文
箬笠
发表于 2025-10-20 23:08:12
#include <stdio.h> //noob54 斗兽棋 int judge(char x) { if (x == 'e')//大象 return 3; else if (x == 't')//老虎 return 2; else if (x == 'c')//猫
展开全文
鹿沉
发表于 2025-06-19 23:35:32
# 输赢的逻辑关系 res = [['elephant', 'tiger'], ['tiger', 'cat'], ['cat', 'mouse'], ['mouse', 'elephant']] line = input().split() # 正序匹配上,则是吃的关
展开全文
lber
发表于 2025-10-11 18:39:53
import java.io.BufferedReader; import java.io.InputStreamReader; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void mai
展开全文
ylbj1
发表于 2025-12-10 17:24:35
#include <iostream> #include <string> #include <unordered_map> using namespace std; int main() { string s1, s2; cin >&g
展开全文
牛客303835616号
发表于 2025-08-13 16:53:09
a = input().split() t = 'tiger' e = 'elephant' c = 'cat' m = 'mouse' niu = a[0] mei = a[1] if niu == t: if mei == c: print ('win') eli
展开全文
CYCQAQ1145
发表于 2025-10-04 13:23:21
#include <stdio.h> int main() { char m[11],n[11]; scanf("%s %s",m,n); if(m[0]=='e'&&n[0]=='t' ||m[0]=='t'&am
展开全文
查看本题
查看本题讨论
相关比赛
5158-牛客小白月赛24
进入比赛
5494-南昌航空大学第四次新生练习赛
进入比赛
5588-牛客小白月赛24(重现赛)@我是一只傻狍子
进入比赛
6250-牛客小白月赛24(重现赛)@极为沙雕的大奶熊礽荣
进入比赛
6251-牛客小白月赛24(重现赛)@极为沙雕的大奶熊礽荣
进入比赛
等你来战
查看全部
2025年大连海事大学程序设计竞赛
报名截止时间:2025-12-14 17:00
2025年广州大学程序设计竞赛新生赛(同步赛)
报名截止时间:2025-12-14 18:30
牛客周赛 Round 122
报名截止时间:2025-12-14 21:00
牛客练习赛147
报名截止时间:2025-12-20 21:30
牛客2025跨年场
报名截止时间:2026-01-01 00:05
2026牛客寒假算法基础集训营1
报名截止时间:2026-02-03 18:00
2026牛客寒假算法基础集训营2
报名截止时间:2026-02-05 18:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题