大神帮看哪里格式需要改进?
#include<stdio.h>#define SIZE 200
main()
{
int a[SIZE];
int count=1;
int pass, hold, num, i;
printf("Please input the number of integers:");
scanf("%d", &num);
printf("Please input the integers:");
for(i=0; i<=num-1; i++){
scanf("%d", &a[i]);
}
for(pass=0; pass<=num-1; pass++){
for(i=0; i<=num-2; i++){
if(a[i]%2!=0&&a[i+1]%2==0){
hold=a[i];
a[i]=a[i+1];
a[i+1]=hold;
}
}
}
printf("The elements of the new array are:");
for(i=0; i<=num-1; i++)
printf("%2d",a[i]);
return 0;
}
题目:排序,偶在前,奇在后