#include
#define MAXSIZE 10
main()
{
int a[MAXSIZE];
int k;
printf("please inter ten number:");
for(k=0;k
scanf("%d",&a[k]);
}
Fun(a);
for(k=0;k
}
void Fun(int a[])
{
int i;
int temp;
int MaxNum=a[0];
int maxIndex = 0;
int minIndex = 0;
int MinNum=a[0];
for(i=0;i<10;i++)
{
if(a[i]>MaxNum)
{
MaxNum=a[i];
maxIndex = i;
}else if(a[i]
MinNum=a[i];
minIndex = i;
}
}
temp = a[maxIndex];
a[maxIndex] = a[minIndex];
a[minIndex] = temp;
}