Find the Positions of Maximum and Minimum Numbers


Submit solution

Points: 45 (partial)
Time limit: 3.0s
Memory limit: 64M

Authors:
Problem type

題目說明

請撰寫一個程式,讓使用者輸入 5 個整數,並找出這些數字中最大值和最小值的位置(以輸入的順序為基準)。程式需要輸出最大值和最小值分別是第幾個數字。

輸入

使用者將輸入 5 個整數,彼此之間以換行分隔。

輸出

輸出兩行,分別為:

  1. 最大值是第幾個數字
  2. 最小值是第幾個數字

範例輸入 #1

10  
20  
30  
40  
50

範例輸出 #1

The 5th number you just entered is the largest
The 1th number you just entered is the smallest

範例輸入 #2

1
1
1
1
1

範例輸出 #2

The 5th number you just entered is the largest
The 5th number you just entered is the smallest

Comments

There are no comments at the moment.