帮帮忙,这个程序该怎样修改才能得到想要的结果
/ Guess My Number// The classic number guessing game
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(0)); // seed random number generator
int theNumber = rand() % 100 + 1; // random number between 1 and 100
int tries = 0, guess;
cout << "\tWelcome to Guess My Number\n\n";
do
{
cout << "Enter a guess: ";
cin >> guess;
++tries;
if (guess > theNumber)
cout << "Too high!\n\n";
if (guess < theNumber)
cout << "Too low!\n\n";
} while (guess != theNumber);
cout << "\nThat's it! You got it in " << tries << " guesses!\n";
return 0;
} 这个程序由玩家猜一个随机数,直到猜出这个数,程序结束,而现在是要求玩家与电脑交换角色,玩家键入一个数,而电脑必须猜出这个数.这个程序该怎样修改呢?望各位达人鼎立相住.谢谢