作者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