Max and Min Differences of Three Integers


Submit solution

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

Author:
Problem type

題目說明

輸入三個整數,程式計算所有數字配對的差額,並輸出最大的差額與最小的差額。提示:把所有差額都算出來,然後找最大值與最小值。

輸入規範

三個整數,每個數字的範圍都是-100到100。數字有可能重複。

輸出規範

兩個整數

範例輸入 #1

11 30 10

範例輸出 #1

20 1

說明:因為30與10的差距是20,而10和11的差距是1

範例輸入 #2

30 -28 -30

範例輸出 #2

60 2

說明:因為-30與30的差距是60,而-28和-30的差距是2


Comments

There are no comments at the moment.