当前位置:网站首页>Figure guessing game
Figure guessing game
2022-06-11 20:28:00 【csdn_ one thousand nine hundred and ninety-seven】
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void menu()// menu
{
printf(" \n");
printf(" 1. Enter the game . \n");
printf(" 0. Quit the game . \n");
printf(" \n");
}
void game()// game
{
int n = rand ()%100+1;
int guess = 0;
while (1)
{
printf(" Please guess the number :");
scanf("%d", &guess);
if (guess>n)
{
printf(" Guess the !");
}
else if(guess<n)
{
printf(" Guess a little !");
}
else
{
printf(" Guessed it !!!");
break;
}
}
}
int main()
{
int x = 0;
srand((unsigned int)time(NULL));
do
{
menu();
printf(" Please select :\n");
scanf("%d", &x);
switch (x)
{
case 1:
game();
break;
case 0:
printf(" Quit the game \n");
break;
default:
printf(" Wrong choice , To choose :\n");
break;
}
} while (x);
return 0;
}边栏推荐
- Module 8 operation
- 8 r subset
- Babbitt yuancosmos daily must read: the secondary market of digital collections is full of chaos. After 00, it will become a new leek. Supervision is imminent
- Lanqi technology joins in, and dragon dragon dragon community welcomes leading chip design manufacturers again
- 26. 定时器
- Simulate Oracle lock waiting and manual unlocking
- Wechat applet | rotation chart
- Show your creativity and win the graphics card! Mmpose attitude estimation creative contest shocks
- On scale of canvas recttransform in ugui
- 使用flask框架写挡板
猜你喜欢

In 2021, the global ceramic substrate revenue will be about US $409.7 million, and it is expected to reach US $657.3 million in 2028

Flutter doctor shows the solution that Xcode is not installed

Unity package manager starting server stuck

全名单!2022泰晤士亚洲大学排名公布!

Première formation sur les largeurs modernes

moderlarts第一次培训

29. location object

27. this pointing problem

UDP、TCP

AHB2Standard_ handshake_ Bridge design
随机推荐
Première formation sur les largeurs modernes
Oracle case: ora-00600: internal error code, arguments: [4187]
The first bullet of comparative learning
Implementation of SQL online editor based on Vue + codemirror
Google proposed the super pre training model coca, and the accuracy of fine-tuning top-1 on Imagenet reached 91%! SOTA! On multiple downstream tasks
RTL arbiter design
Systematically study the recommendation system from a global perspective to improve competitiveness in actual combat (Chapter 8)
VS2010 cannot open when linking sql2008 database
Web3 product manager guide - Jason
sql优化之DATE_FORMAT()函数
AHB_ Bus_ Matrix_ 3x3 design
Current situation and future development trend of tropical forage seed market in the world and China from 2022 to 2028
修改本地微信小程序的AppID
Leetcode2027. 转换字符串的最少操作次数(可以,一次过)
Babbitt yuancosmos daily must read: the secondary market of digital collections is full of chaos. After 00, it will become a new leek. Supervision is imminent
秀创意,赢显卡!MMPose姿态估计创意大赛震撼来袭
Installation and performance test of Apache APIs IX on Amazon graviton3
unity package manager starting server stuck(Unity啟動卡在starting server,然後報錯)
2022-2028 global and Chinese thermal conductivity hydrogen analyzer Market Status and future development trend
STC 纯硬件自动下载电路 V2