#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <math.h>
using namespace std;
int RandomTem ( );
int RandomTem ( )
{
srand ((unsigned int)time (NULL));
int num = 0;
for (int i = 0; i < 3; i++)
cout <<"T=" << num + rand( ) % 16 + 4 << ' ';
cout << endl;
return (num + rand( ) % 16 + 4);
}
int main ( )
{
for (int j = 0; j < 3; j++)
{
cout << endl;
cout << RandomTem ( ) * RandomTem ( ) + RandomTem ( ) + 2 + 1 << endl;
}
}
加一个种子就好了