#include<stdio.h>
#include <stdlib.h>
int main(){
    printf("剪子包袱锤游戏\n");
    int isTrue  = 1;
    int userInput;
    int systemInput;
    char *types[3] = {"剪子","包袱",""};
    while (isTrue)
    {
        printf("请输入 0剪子 1包袱 2锤:\n");
        scanf("%d", &userInput);
        systemInput =  rand() % 3;
        printf("系统出:%s\n", types[systemInput]);
        printf("你出:%s\n", types[userInput]);
        if(systemInput == userInput){
            printf("平局\n");
            continue;
        }
        if((systemInput-1) == userInput){
            printf("你赢\n");
            continue;
        }else{
            printf("系统赢\n");
            continue;
        }
    }
    return 0;
}

 

相关文章:

  • 2021-08-26
  • 2021-09-22
  • 2021-11-07
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-04-06
猜你喜欢
  • 2022-12-23
  • 2022-01-22
  • 2021-07-09
  • 2021-11-06
  • 2021-07-14
  • 2021-10-02
相关资源
相似解决方案