• 个人简介

    import random print("="*50) print("欢迎来到猫狗识别小课堂!") print("="*50)

    while(True): print("\n请选择你想玩的游戏:") print("1.认识猫狗特征") print("2.猜动物游戏") print("3.猜图片游戏") print("4.退出")

    choice=input("输入数字(1-4)")
    
    if choice=="1":
        print("\n猫咪的特征:")
        print("1. 尖耳朵")
        print("2. 长胡子")
        print("3. 走路轻")
        print("4. 喵喵叫")
    
        print("\n狗狗的特征:")
        print("1. 大耳朵")
        print("2. 长舌头")
        print("3. 爱摇尾巴")
        print("4. 汪汪叫")
    
        input("\n按回车继续游戏")
    
    if choice=="2":
        print("猜动物游戏开始!")
        score=0
    
        game=1
        while game<=3:
            print(f"\n第{game}题:")
            feature=0
            if random.random()>0.5:
                animals="猫"
                if random.random() > 0.5:
                    feature="尖耳朵,走路没有声音"
                else:
                    feature="长胡子,喵喵叫"
            else:
                animals="狗"
                if random.random() > 0.5:
                    feature="大耳朵,爱摇尾巴"
                else:
                    feature="长舌头,汪汪叫"
            print(f"这个动物,{feature}")
            guess=input("你猜是猫还是狗?:")
            if guess==animals:
                print("猜对了,太棒了!")
                score+=1
            else:
                print(f"答错了,正确答案是:{animals}")
            print(f"当前得分:{score}/{games}")
            games+=1
    
  • 通过的题目

  • 最近活动

题目标签

基础问题
10
顺序结构
6
信息学奥赛一本通
3
顺序结构实例
2
系统测试
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3002
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3007
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3020
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3050
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3051
1
http://bas.ssoier.cn:8086/problem_show.php?pid=3063
1
C++语言入门
1
洛谷
1
字符串
1
noip复赛
1