我只字不提一些快速的假想游戏法,但我却继续犯“超标不合格”错误。
我检查了所有半殖民地,但也许我会错过一些东西?
我的守则如下:
#include <iostream>
#include <stdlib.h> // srand
using std::cout;
using std::endl;
using std::cin;
int main(void) {
/* code goes here */
srand (time(NULL));
int number = rand() % 100+1;
int guess = 0;
cout << number << endl; /* debug */
do {
/* code goes here */
cout << "Guess a number between 1 and 100: ";
cin >> guess;
if ( guess > number ) { cout << "Too high, try again.
" << endl;}
else if ( guess < number ) { cout << "Too low, try again.
" << endl; }
else { cout << "That s right!
" << endl; }
exit(0);
} // fi
while ((number));! std:: = guess);
return (0); }
// main }`
此处为错误案文:
ERROR!
/tmp/3NFruHJf2U.cpp: In function int main() :
/tmp/3NFruHJf2U.cpp:27:27: error: expected unqualified-id before = token
27 | while ((number));! std:: = guess);
| ^