how much can I get?
Submit solution
Points:
50 (partial)
Time limit:
1.0s
Memory limit:
256M
Authors:
Problem type
Allowed languages
Java 19, Java 8
題目說明
統一發票的數字碼為8位阿拉伯數字,例如62474899
,如果只考慮末四碼與該
期頭獎相同者各得獎金一千元,末三碼與頭獎相同者各得獎金二百元。
請設計一程式讓使用者輸入當期頭獎號碼,並接續輸入發票號,最後輸出你的中獎發票號碼及獎金。
輸入限制: 須為8個數字,第一位不能為0
輸入
當期頭獎號碼,要兌獎的發票號碼,輸入0則結束輸入
輸出
有中獎的發票號碼跟獲得的獎金,若都沒有中獎則輸出再接再厲
sample input1
62474899 62473799 62474898 62474897 0
sample output1
再接再厲
sample input2
15429688 15339688 15359677 15359888 15552795 55217688 15333368 15579688 0
sample output2
15339688: $1000
55217688: $200
15579688: $1000
Comments