You are viewing a single comment's thread. Return to all comments →
public static void Main() { int[] array = Array.ConvertAll(Console.ReadLine().Split(' '), c => Convert.ToInt32(c)); Array.Sort(array); long minSum = 0; long maxSum = 0; for (int i = 0; i < array.Length - 1; i++) { minSum += array[i]; } for (int i = 1; i < array.Length; i++) { maxSum += array[i]; } Console.WriteLine(minSum + " " + maxSum);
}
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 →
My solution for C-Sharp(C#)
}