You are viewing a single comment's thread. Return to all comments →
Simplest Java solution
public static void main(String[] args) { Scanner in = new Scanner(System.in); long[] arr = new long[5]; for(int arr_i=0; arr_i < 5; arr_i++){ arr[arr_i] = in.nextLong(); } Arrays.sort(arr); System.out.println(arr[0] + arr[1] + arr[2] + arr[3] + " " + (arr[1] + arr[2] + arr[3] + arr[4])); }
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Simplest Java solution