The sum of the largest and the smallest
The array of integers is given. Find the sum of the smallest and the largest element in array.
The first line contains the number of elements n (n ≤ 100) in array. n array elements are given in the second line. Each number in array does not exceed 100 by absolute value.
Print the sum of the smallest and the largest element in array.
4 1 2 3 4