首页 > 斗兽棋
头像 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-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-08-13 11:37:11
#include <iostream> using namespace std; int main() { string s1,s2; cin>>s1>>s2; if (s2=="elephant"&& 展开全文
头像 鹿沉
发表于 2025-06-19 23:35:32
# 输赢的逻辑关系 res = [['elephant', 'tiger'], ['tiger', 'cat'], ['cat', 'mouse'], ['mouse', 'elephant']] line = input().split() # 正序匹配上,则是吃的关 展开全文
头像 双料虾牛皇堡
发表于 2025-06-30 01:43:10
#include <stdio.h> #include <string.h> int main() { char s1[10], s2[10]; scanf("%s %s", s1, s2); if ((strcmp 展开全文
头像 超级汉堡ham
发表于 2025-08-05 23:05:12
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = 展开全文
头像 裁空
发表于 2025-07-21 18:59:50
#include <iostream> using namespace std; int main() { string s1,s2; cin>>s1>>s2; if(s1=="elephant"&&s 展开全文
头像 牛客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 展开全文
头像 何成95
发表于 2025-08-29 19:14:25
nn, nm = input().split() game = ["elephant","tiger","cat","mouse"] idn, idm = game.index(nn), game.index(nm) 展开全文