当前位置:网站首页>【c】 Digital bomb
【c】 Digital bomb
2022-07-03 20:06:00 【Paradox 502】
void game()
{
int b = 0;
int let = 0;
let=rand()%100+1;
int left = 0;
int right = 100;
while (b != let)
{
printf(" Guess the number >:");
(void)scanf("%d", &b);
/*Sleep(1000)*/;
system("CLS");
if (b < let && b>left)
{
left = b;
printf(" Less than the number of bombs \n The scope is %d-%d\n",left,right);
}
else if (b > let && b<right)
{
right = b;
printf(" Larger than the number of bombs \n The scope is %d-%d\n", left, right);
}
/*if (b <= left || b >=right)*/
else if(b>right||b<left)
printf(" Out of range, please input again \n The scope is %d-%d\n", left, right);
}
printf("\ngame over\n");
}
void menu()
{
printf("*******************************\n");
printf("***** 1.play 0.exit *******\n");
printf("*******************************\n");
}
int main()
{
srand((unsigned int)time(NULL));
int input = 0;
do
{
menu();
printf(" Please select >:");
(void)scanf("%d", &input);
switch (input)
{
case 1:
game();
break;
case 0:
printf(" Quit the game \n");
break;
default:
printf(" Wrong choice \n");
break;
}
} while (input);
return 0;
}
边栏推荐
- Micro service knowledge sorting - cache technology
- Utilisation de base du cadre unitest
- 2. Template syntax
- Camera calibration (I): robot hand eye calibration
- Print linked list from end to end
- AcWing 1460. Where am i?
- BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
- How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
- Promethus
- 4. Data splitting of Flink real-time project
猜你喜欢

MPLS configuration

BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu

1.4 learn more about functions

FPGA 学习笔记:Vivado 2019.1 工程创建

2022-07-02 advanced network engineering (XV) routing policy - route policy feature, policy based routing, MQC (modular QoS command line)
![CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析](/img/70/6fd00146418e5d481e951d51428990.png)
CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析

Upgrade PIP and install Libraries

2.7 format output of values

Point cloud data denoising

Ae/pr/fcpx super visual effects plug-in package fxfactory
随机推荐
Bool blind note - score query
Initialization and instantiation
BOC protected tryptophan zinc porphyrin (Zn · TAPP Trp BOC) / copper porphyrin (Cu · TAPP Trp BOC) / cobalt porphyrin (cobalt · TAPP Trp BOC) / iron porphyrin (Fe · TAPP Trp BOC) / Qiyue supply
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
Leetcode daily question solution: 540 A single element in an ordered array
How to improve data security by renting servers in Hong Kong
Explore the internal mechanism of modern browsers (I) (original translation)
Global and Chinese markets for medical temperature sensors 2022-2028: Research Report on technology, participants, trends, market size and share
BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
4. Data binding
Test panghu was teaching you how to use the technical code to flirt with girls online on Valentine's Day 520
Assign the CMD command execution result to a variable
PR FAQ: how to set PR vertical screen sequence?
Test changes in Devops mode -- learning and thinking
Print linked list from end to end
6. Data agent object Defineproperty method
Strict data sheet of new features of SQLite 3.37.0
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
Make a simple text logo with DW
P5.js development - setting