<h1>include <iostream></h1> <h1>include <cstdlib></h1> <h1>include <ctime></h1> using namespace std; int main() { // 初始化随机数生成器 srand(time(0)); // 生成1-100之间的随机数 int secretNumber = rand() % 100 + 1; int guess = 0; int attempts = 0; cout << "欢迎来到猜数字游戏!" << endl; cout << "我已经想好了一个1到100之间的数字,你能猜出来吗?" << endl; while (guess != secretNumber) { cout << "请输入你的猜测: "; cin >> guess; attempts++; if (guess > sec