#include <stdio.h>

int main()
{
	int a[1001], n;
	printf("Please input n: ");
	scanf_s("%d", &n);
	printf("Please enter %d numbers: ", n);
	int i;
	for (i = 0; i < n; i++)
	{
		scanf_s("%d", &a[i]);
	}
	int min = a[0], index = 0;
	for (i = 1; i < n; i++)
	{
		if (min > a[i])
		{
			min = a[i];
			index = i;
		}
	}
	a[index] = a[0];
	a[0] = min;
	printf("The result is: ");
	for (i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	return 0;
}