| 3 | import java.util.Scanner; |
| 4 | |
| 5 | public class Problem5 { |
| 6 | |
| 7 | public static int getMax(int[] inputArray) { |
| 8 | int maxValue = inputArray[0]; |
| 9 | |
| 10 | for (int i = 1; i < inputArray.length; i++) { |
| 11 | if (inputArray[i] > maxValue) { |
| 12 | maxValue = inputArray[i]; |
| 13 | } |
| 14 | } |
| 15 | return maxValue; |
| 16 | } |
| 17 | |
| 18 | public static int getMin(int[] inputArray) { |
| 19 | int minValue = inputArray[0]; |
| 20 | |
| 21 | for (int i = 1; i < inputArray.length; i++) { |
| 22 | if (inputArray[i] < minValue) { |
| 23 | minValue = inputArray[i]; |
| 24 | } |
| 25 | } |
| 26 | return minValue; |
| 27 | } |
| 28 | |
| 29 | public static void main(String[] args) { |
| 30 | // TODO Auto-generated method stub |
| 31 | Scanner scan = new Scanner(System.in); |
| 32 | int[][] maxMin; |
| 33 | int N; |
| 34 | String line; |
| 35 | String[] numbersInALineStr; |
| 36 | int[] numbersInALineStrInt; |
| 37 | |
| 38 | N = scan.nextInt(); |
| 39 | scan.nextLine(); |
| 40 | maxMin = new int[N][2]; |
| 41 | |
| 42 | for (int i = 0; i < N; i++) { |
| 43 | line = scan.nextLine(); |
| 44 | |
| 45 | numbersInALineStr = line.trim().split("\\s+"); |
| 46 | numbersInALineStrInt = new int[numbersInALineStr.length]; |
| 47 | |
| 48 | for (int j = 0; j < numbersInALineStr.length; j++) { |
| 49 | numbersInALineStrInt[j] = Integer.parseInt(numbersInALineStr[j]); |
| 50 | } |
| 51 | |
| 52 | for (int number : numbersInALineStrInt) { |
| 53 | while (number < 0 || number > 100) { |
| 54 | line = scan.nextLine(); |
| 55 | |
| 56 | numbersInALineStr = line.trim().split("\\s+"); |
| 57 | numbersInALineStrInt = new int[numbersInALineStr.length]; |
| 58 | |
| 59 | for (int j = 0; j < numbersInALineStr.length; j++) { |
| 60 | numbersInALineStrInt[j] = Integer.parseInt(numbersInALineStr[j]); |
| 61 | } |
| 62 | } |
nothing calls this directly
no outgoing calls
no test coverage detected