4999: 【41课】【3248】最小数和最大数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:116 Solved:70

Description

输入 n 个数,找到其中最小的数和最大的数。

Input

第一行一个整数 n (1≤n≤100),表示数据的个数。
第二行 n 个整数 ai(1≤ai≤10000)

Output

两个整数,分别表示最小的数和最大的数

Sample Input Copy

4
3 9 8 1

Sample Output Copy

1 9