1805: 【CSP数组】最小数▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:15 Solved:5

Description

输入 lns="http://www.w3.org/1998/Math/MathML">n 个整数的数列,请找出数列中最小数所在的位置(若有多个最小数,则选最左边的那个最小数),把它与数列的第一个数对调,其他数的位置不动,输出此数列。

Input

第 lns="http://www.w3.org/1998/Math/MathML">1 行输入数组元素的个数 lns="http://www.w3.org/1998/Math/MathML">nlns="http://www.w3.org/1998/Math/MathML">2n≤100);

第 lns="http://www.w3.org/1998/Math/MathML">2 行输入 lns="http://www.w3.org/1998/Math/MathML">n 个整数,用空格分开(lns="http://www.w3.org/1998/Math/MathML">0数组元素lns="http://www.w3.org/1998/Math/MathML">40000)。

Output

第一行:最小数所在的位置(只需要输出最左边的一个的位置);

第二行:交换后的数组(一个空格隔开)。

Sample Input Copy

3
2 6 1

Sample Output Copy

3
1 6 2