EE: Introduction to Computers (I)

Homework 5, Due 12/23

1. Page 140, Exercise 4.26. (25%)

2. Page 140, Exercise 4.27. (25%)

3. Page 141, Exercise 4.36. (25%)

Example output (partial, May-December not shown):

4. 樂透彩中獎說明:凡投注購券者所選之六個號碼中,有三個以上〈含三個 〉號碼與開出之六個號碼相同者〈附加之特別號碼只適合貳獎用〉,便為中獎彩券,並可依規定請領獎金。

中獎獎號與獎項之分配情形,說明如下表:

獎別        對中號碼數                                簽中機率 
頭獎        六個數字全中                            1/5245786 
貳獎        對中任五個號碼+特別號        1/874297.7 
參獎        對中任五個號碼                        1/24979.9 
肆獎        對中任四個號碼                        1/555.1 
普獎        對中任三個號碼                        1/36.7 

資料來源:中華民國公益彩券

第 093099 期中獎號碼 03, 19, 24, 30, 40, 41 特別號 05 

Write a program that inputs six integers,  match them against the above official drawing, determine if there is a prize and which the prize item is when there is a prize, and output the result.    (25%)