题目描述

Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. [Note: Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] Figure 7.26 shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).


输入格式

No input required.


输出格式

Print the results in a tabular format.


样例数据

输入


                            

输出

       Sum     Total  Expected    Actual
         2       989    2.778%    2.747%
         3      2009    5.556%    5.581%
         4      3052    8.333%    8.478%
         5      4091   11.111%   11.364%
         6      4983   13.889%   13.842%
         7      5965   16.667%   16.569%
         8      4897   13.889%   13.603%
         9      4048   11.111%   11.244%
        10      3066    8.333%    8.517%
        11      1965    5.556%    5.458%
        12       935    2.778%    2.597%

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解