Ответы
Ответ дал:
0
Язык C++.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main () {
int b = 0;
int c = 1;
int min = 1;
int max = 10;
srand ( time(NULL) );
int n = min + rand() % (max - min);
do{
cout << "Guess the number: " << endl;
cin >> b;
++c;
if (c > 3)
return 3;
}
while (b != n);
cout << "You are right!" << endl;
}
#include <iostream>
#include <stdlib.h>
using namespace std;
int main () {
int b = 0;
int c = 1;
int min = 1;
int max = 10;
srand ( time(NULL) );
int n = min + rand() % (max - min);
do{
cout << "Guess the number: " << endl;
cin >> b;
++c;
if (c > 3)
return 3;
}
while (b != n);
cout << "You are right!" << endl;
}
Вас заинтересует
2 года назад
2 года назад
3 года назад
3 года назад
9 лет назад
10 лет назад
10 лет назад