C语言考试练习题_最值

Time Limit
1s
Memory Limit
32768KB
Judge Program
Standard
Ratio(Solve/Submit)
14.81%(910/6146)
Description:

有一个长度为n的整数序列。请写一个程序,先把序列中的最小值与第一个数交换,再最大值与最后一个数交换。输出转换好的序列。

Input:

输入包括两行。 第一行为正整数n(1≤n≤10)。 第二行为n个正整数组成的序列。保证输入数据没有重复的数字。

Output:

输出转换好的序列。数据之间用空格隔开。

Sample Input:
5
2 1 5 4 3
Sample Output:
1 2 3 4 5
Source:

2007-2008学年第一学期C语言上机考试


Submit