#include <iostream>
int main()
{
int i, n, dice1, dice2;
cout << "Please input an integer as the random seed -- ";
cin >> i;
cout << endl;
srand(i);
for (i=0; i<10; i++)
{
dice1 = rand() % 6 + 1;
dice2 = rand() % 6 + 1;
n = dice1 + dice2; // The value of n will be between 2 and 12.
std::cout << dice1 << '+' << dice2 << '=' << n << std::endl;
}
return 0;
}
Please input an integer as the random seed -- 318
2 - 5
3 - 8
4 - 5
5 - 10
6 - 11
7 - 11
8 - 24
9 - 7
10 - 13
11 - 4
12 - 2