我得到第一個其他人的expected primary-expression before "else"
錯誤,我不明白爲什麼。我三重檢查了所有的支撐。「else」錯誤之前的預期主表達式
if(Owin = win)
{
cout << "The computer has defeated you!\n\n";
cout << "Would you like to play again? (Y or N) : ";
cin >> restart;
if(restart == 'Y' || restart == 'y');
{
cout << "\n\n\n";
main() ;
}
else
{
cout << "Good Bye!\n\n";
system("pause");
return(0);
}
}
else
{
}
您不能像這樣遞歸調用'main',並且您的編譯器應該警告您關於if中的單個等號。 – chris
(使用一個體面的編程編輯器「自動縮進」可能會顯示這個微不足道的錯誤,它也將使代碼*更*可讀性。) – 2012-12-19 03:50:16
其實克里斯我可以打電話給這樣的主...它在主要 – user1914650