#include<stdio.h>
int main()
{
int n,i,j,h;
int a[100];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
int max=a[0];
for(i=0;i<n;i++)
{ if(max<a[i])
{
max=a[i];h=i;
}
}
if(max%2==0){a[h]=a[n-1];a[n-1]=max;
}else {
a[h]=a[0];a[0]=max;
}
for(i=0;i<n;i++)
{printf("%d",a[i]);if(i<n-1)printf(" ");
}
return 0;
}
标签:return,int,max,11.14,include,scanf From: https://blog.51cto.com/u_15758636/5849074