C程序代码分析
#include <stdio.h>int main (void)
{
int i,j,n,x,a[5];
printf("Enter n:\n");
scanf("%d",&n);
printf("Enter %d integers:\n",n);
for (i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Enter x: ");
scanf("%d",&x);
for(i=0;i<n;i++)
{
if(x>a[i]) continue;
j=n-1;
while (j>=i)
{
a[j+1]=a[j];
j--;
}
a[i]=x;
break;
}
if (i==n) a[n]=x;
for (i=0;i<n+1;i++)
printf ("%d ",a[i]);
putchar('\n');
return 0;
}
各位高手,你好,求详细解答,谢谢,如果可以的话答案请发到我邮箱:609227801@