用宝贝这种词比较粗俗,但为什么不添加一些自己的
幽默让枯燥的代码生动起来呢
#include
#include
#include
#include
void menu()
{
printf("**************************\n");
printf("** 1.play ** 0.exit **\n");
printf("**************************\n");
}
void game()
{
int ret = 0;
int guess = 0;
ret = rand() % 100 + 1;
while (1)
{
printf("请美丽无敌宝宝猜测数字:");
scanf_s("%d", &guess);
if (ret > guess)
{
printf("太惋惜辣,宝宝你猜小了(●'◡'●),加油!\n");
}
else if (ret < guess)
{
printf("很遗憾,宝贝你猜大了(^U^)ノ~YO\n");
}
else
{
printf("恭喜宝贝猜对了!!!给你一个摸摸哒O(∩_∩)O\n");
break;
}
}
}
int main()
{
int input = 0;
srand((unsigned int)time(NULL));
do
{
menu();
printf("请宝贝选择:");
scanf_s("%d", &input);
switch (input)
{
case 1:
game();
break;
case 0:
printf("俺也不玩啦");
break;
default:
printf("可耐的宝贝你是不是按错了鸭");
break;
}
}while (input);
return 0;
}