#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int randNum;
int chioce;
srand((unsigned int)time(NULL));
printf("欢迎来到筛子游戏\n");
printf("猜【小】输入【0】,猜【大】输入【1】,0/1:");
scanf("%d",&chioce);
randNum=rand()%6+1;
printf("筛子点数:%d\n",randNum);
if(randNum<=3&&chioce==0||randNum>3&&chioce==1)
printf("猜对了");
else
printf("很可惜猜错了,祝下次好运");
return 0;
}
c语言学习记录随机骰子
于 2024-04-11 20:45:14 首次发布