#include <iostream>
#include <windows.h>
#include <cstdlib>
using namespace std;
bool setstart = true;
int main(){
int x;
int y;
cout << "Welcome to the guessing game\n";
do {
cout << "Please enter a number from 0 to 100: ";
cin >> x;
} while (x < 0 || x > 100);Sleep(2000);
system("cls");
cout<<"ok player 2 pick the guess";
cin>>y;
if (x == y){
cout<<"congrats you got it right";
}
else{
if (x < y){
cout<<"Go lower";}
else {
if (x > y){
cout<<"higher";}}
}
system("pause>nul");
return 0;
}
私は本当にそれを理解していません。どのように使用しますか?また、do と while は Do が起こっていることを意味し、それが起こっている間は While をしますか? これは私の友人が私のために作ったコードですが、本当に具体的に説明できる人はいますか?