#C12690. Dice Roller Simulation
Dice Roller Simulation
Dice Roller Simulation
You are required to simulate a dice rolling process. In this problem, you need to implement a program that reads the number of dice rolls and a seed for the random number generator from standard input. Using the seed, initialize your random number generator. For each roll, simulate the roll of two fair six‐sided dice. Each roll should:
- Increment the roll count.
- Generate two random integers between 1 and 6 (inclusive).
- Print a line in the format:
Roll count: i
(where i is the current roll number). - Print the sum of the two dice on the next line. Note that the sum is always in the range \(2 \leq sum \leq 12\).
The randomness must be seeded using the provided seed so that the output is deterministic.
inputFormat
The input is provided via standard input and consists of two lines:
- An integer \(N\) (\(1 \leq N \leq 1000\)) representing the number of dice rolls.
- An integer \(S\) used as the seed for the random number generator.
outputFormat
The output should be printed to standard output. For each dice roll, output two lines:
- A line in the format
Roll count: i
, wherei
is the roll number (starting from 1). - A line containing the sum of the two dice (an integer between 2 and 12).
3
1
Roll count: 1
7
Roll count: 2
6
Roll count: 3
8
</p>