- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- #include <ctime>
- using namespace std;
- int main ()
- {
- int guess;
- char answ;
- srand (time (0));
- for (int i = 0; i < 100; i++)
- {
- int random = rand();
- int num = ((random % 100) + 1);
- printf("Guess a number between 1 to 100:\n");
- scanf("%d", guess);
- if (guess > num)
- {
- printf("the number you guess is too smaller. Try again??\n");
- continue;
- }
- if (guess < num)
- {
- printf("the number you guess is too bigger. Try again??\n");
- continue;
- }
- else if (guess = num)
- {
- printf("congrulation !!");
- break;
- }
- }
- return 0;
- }
我走的到,不过会有问题,大家帮我查查T.T




