1081: 数组的最大值和最小值

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:25 Solved:20

Description

给定一个整数数组,找出数组中的最大值和最小值,并输出它们。数组的长度为n(1 < n < 100)。

Input

第一行:一个整数n。

第二行:n个空格隔开的整数。

Output

第一行:最大值

第二行:最小值

Sample Input Copy

5
10 20 30 40 50

Sample Output Copy

50
10