作者ric2k1 (Ric)
看板EE_DSnP
标题[情报] 期末考示范考题 (二)
时间Sun Jan 13 23:55:27 2008
Please write a program to:
(1) Randomly generate 30 integers between [0, 9] (inclusive).
(2) Record the number of repeats of each number.
(3) Print out the numbers of repeats as follows:
#repeats
10|
9|
8|
7|
6|
5| * *
4| * * * *
3| * * * * * *
2| * * * * * * * *
1| * * * * * * * * * *
-0----------------------> number
0 1 2 3 4 5 6 7 8 9
Please note:
(1) Do not change the format of the coordinate axes.
(2) If the number of repeats of any number exceeds 10, record it as 10.
(3) Please make sure the random numbers are different every time you run.
(4) Include <cstdlib> for random number generation function.
(5) Grading criteria: correctness (100%)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.135.175
1F:→ ric2k1:这题难易度是: 简单 (但是要花时间写...) 01/13 23:55
※ 编辑: ric2k1 来自: 59.121.135.175 (01/13 23:58)
※ 编辑: ric2k1 来自: 59.121.135.175 (01/14 00:01)
2F:→ ilway25:debug 好几次才过- - 01/14 00:03
3F:→ keyboardle:我也笨了好几次才过= =... 01/14 00:26
4F:推 flarehunter:糟了我也错好多次… 01/14 20:43
5F:推 eemingh:看来我需要哪位大强者的详解...... 01/14 23:25