3rd? 2nd? 1st?


Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type

題目說明

輸入十個數字,輸出第三大的數字,如果沒有第三大的數字,則輸出第二大的數字,如果沒有第二大的數字,則輸出第一大的數字。

輸入資料限制:輸入數字都是整數,最小為-1000,最大為1000。

輸入

十個整數

輸出

第三大的數字(若無就第二,無第二就第一)

sample input1

-5 5 -4 4 -3 3 -2 2 -1 1

sample output1

3

sample input2

1 2 1 2 1 2 1 2 1 2

sample output2

1

sample input3

5 5 5 5 5 5 5 5 5 5

sample output3

5

Comments

There are no comments at the moment.