Я завершаю свой школьный проект. Я написал все, но, кажется, есть ошибка:Отсутствует; перед идентификатором cout
missing ";" before cout at line 15 before " your number is bigger than..."
Я не могу понять эту ошибку или исправить ее. Пожалуйста помоги. Код для всей программы следующим образом:
#include <iostream>
using namespace std;
int main()
{
int intSecretNum = 47;
int intGuess;
cout<< "Guess the secret number (between 0 and 100 inclusively): ";
cin>> intGuess;
while(intSecretNum != 47, intGuess<= 5)
{
if(intGuess < intSecretNum)
cout << "Your Number is smaller than the secret number";
else (intGuess > intSecretNum)
cout << "Your Number is bigger than the secret number";
intGuess++;
if(intGuess>5)
cout << "Sorry, you have used up all your quota (5 times)! The secret number is "<<intSecretNum;
cout << "program terminated." <<endl;
}
cout<< "You have used "<<intGuess <<"to guess te secret number which is " <<intSecretNum<<".";
cout<<"program terminated."<<endl;
return 0;
}
Я довольно новыми для этого C++, пожалуйста, помогите
'else (intGuess> intSecretNum)' -> 'else' не принимает условие' else if' does – Borgleader
Есть и другие вещи: какая точка 'intSecretNum! = 47' в цикле while ? Что вы делаете, если ваш 'intguess == intSecretNum'? –
Что вы хотите, когда угадаете, соответствует секретному номеру? –