#include <stdio.h>
int main() {
int a[15] = {9,12,13,23,24,35,46,54,57,67,89};
int i,j,x,n = 11;
int flag = 1;
for(i = 0; i < n; ++i)
printf("%d ",a[i]);
printf("\n要插入的数:");
scanf("%d",&x);
for(i = 0; i < n && flag; ++i) {
if(a[i] > x) {
for(j = n; j > i; --j)
a[j] = a[j - 1];
a[i] = x;
flag = 0;
}
}
if(flag) a[n] = x;
++n;
printf("删除%d后:\n",x);
for(i = 0; i < n; ++i)
printf("%d ",a[i]);
printf("\n");
return 0;
}
追问谢谢