http://acm.hdu.edu.cn/showproblem.php?pid=2016
#include <iostream>
using namespace std;
int main(void)
{
int m,i;
int min;
float a[100];
float temp;
cin >> m;
while (m)
{
for (i = 0; i < m;i++)
{
cin >> a[i];
if (i==0)
{
min = 0;
}
else if (a[min]>a[i])
{
min = i;
}
}
if (min)
{
temp = a[min];
a[min] = a[0];
a[0] = temp;
}
for (i = 0; i < m-1;i++)
{
cout << a[i] << " ";
}
cout << a[i] << endl;
cin >> m;
}
return 0;
}