| 7 | import java.util.regex.*; |
| 8 | |
| 9 | public class MiniMaxSum { |
| 10 | |
| 11 | |
| 12 | public static void main(String[] args) { |
| 13 | Scanner input = new Scanner(System.in); |
| 14 | long[] arr = new long[5]; |
| 15 | for(int i=0;i<5;i++){ |
| 16 | arr[i] = input.nextLong(); |
| 17 | } |
| 18 | for(int i=0;i<5;i++){ |
| 19 | for(int j=1;j<(5-i);j++){ |
| 20 | if(arr[j] < arr[j-1]){ |
| 21 | long temp = arr[j]; |
| 22 | arr[j] = arr[j-1]; |
| 23 | arr[j-1] = temp; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | System.out.print(arr[0] + arr[1] + arr[2] + arr[3]); |
| 29 | System.out.print(" "); |
| 30 | System.out.print(arr[4] + arr[1] + arr[2] + arr[3]); |
| 31 | } |
| 32 | } |
nothing calls this directly
no outgoing calls
no test coverage detected