This problem is that find and display the largest value and the smallest value from tester input.
Tester defines N=10 values from input data and store it in array array[]. To find the largest value and smallest value, the first two values of array are checked and largest of these two values is placed in array[0].
Then, the first and third values are checked and largest of these two values is placed in array[0]. This process continues until and first and last values are checked. After this process, the largest value of an array will be in array[0] position. All checked after, to printed the largest value.
Then checked smallest value, the first and third values are checked and smallest of these two value is placed in array[0]. This process continues until and first and last values are checked. The smallest value of array[] position will be printed.
The number is limit between -100 and 100.
這個問題是找到並顯示測試輸入的最大值和最小值。
測試輸入資料定義N = 10個值並將其存儲在陣列array[]中。 為了找到最大值和最小值,檢查陣列的前兩個值,並將這兩個值中的最大值放在array[0]中。
然後,檢查第一個和第三個值,並將這兩個值中的最大值放在array[0]中。 此過程將繼續,直到檢查第一個和最後一個值。 在此過程之後,陣列的最大值將位於array[0]位置。 全部檢查後,輸出最大值。
然後檢查最小值,檢查第一個和第三個值,並將這兩個值中的最小值放在array[0]中。 此過程將繼續,直到檢查第一個和最後一個值。 輸出array[]位置的最小值。
數字限制在-100和100之間。
Tester need to input 10 data, as 56, 8, -6, -78, 88, 14, 35, 46, 25, 10 。
測試需要輸入10個數據,如56, 8, -6, -78, 88, 14, 35, 46, 25, 10。
Largest number = 88
Smallest number = -78
56 8 -6 -78 88 14 35 46 25 10
Largest number = 88 Smallest number = -78
編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
沒有發現任何「解題報告」 |