猜数字游戏
#include<stdio.h>
void menu()
{
printf("*******************\n");
printf("***1.进入 0.退出***\n");
printf("*******************\n");
}
void game()
{
printf("猜数字\n");
}
int main()
{
int input = 0;
do
{
menu();
printf("请选择>:");
scanf_s("%d", &input);
switch (input)
{
case 1:
game();
break;
case 0:
printf("退出游戏\n");
break;
default:
printf("输入错误,重新输入\n");
break;
}
} while (input);
return 0;
}
标签:玩游戏,int,menu,什么,C语言,break,game,printf,input From: https://blog.51cto.com/u_15806064/5826050