为啥运行不成功呢??
程序代码:
# include <stdio.h> # include <stdlib.h> # include <time.h> int main(void) { int Roll_Count, mest, play;//mest是检测循环是否运行,play是玩家输入数值 mest = 1; srand(time(0)); Roll_Count = rand() % 1000; printf("猜数字游戏开始!\n"); while (mest > 0) { scanf("%d", play); if (play == Roll_Count)//判断是否正确 { printf("恭喜你获得胜利!猜对" "了!答案就是%d!\n", play); mest = 0; } else { if (play < Roll_Count)//判断是太大还是太小 { printf("您输入的数%d太小,请" "重新输入!/n", play); } else { printf("您输入的数%d太大,请" "重新输入!/n", play); } mest = 1; } } printf("游戏结束!/n"); return 0; }