#include <iostream> // Библиотеки
#include <cstdlib>
#include <ctime>
using namespace std;
int main() //Главный код
{
srand(static_cast<unsigned int>(time(0))); //Рандом
int RandNum = rand()% 10 + 1;
try = 0;
int a;
cout << "\t Welcome)"<< endl << endl;
do{ // Цикл
cout << "Enter a number: "
cin >> a;
++try;
if(a < RandNum){
cout << "To low: ";
}
else if(a > RandNum){
cout << "To High: ";
}
else
cout << "You got it in " << try << "try"
}
_getch();
return 0;
}
выдает ошибку у int try = 0 // Требует зачем-то }
int
пропустили.