填写完整
#include <stdio.h>
int main()
{ int a[11]={1,4,6,9,13,16,19,28,40,100}; (自己假设,数组从小到大排列)
int temp1,temp2,number,end,i,j;
printf("array a:\n");
for (i=0;i<10;i++)
printf("%5d",a[i]);
printf("\n");
printf("insert data:");
scanf("%d",&number);
end=a[9];
if (number>end)
;
else
{ for (i=0;i<10;i++)
{ if ( )
{ temp1=a[i];
a[i]=number;
for (j= ;j<11;j++)
{ temp2=a[j];
;
temp1=temp2;
}
break; //解释break在此处的作用
}
}
}
printf("Now array a:\n");
for (i=0;i<11;i++)
printf("%5d",a[i]); //解释蓝色字体程序的作用
return 0;
}
能帮我解决这个问题吗
#include <stdio.h>
end=a[9];
if (number>end)
------------------- ;
else
{ for (i=0;i<10;i++)
{ if (-------------- )
{ temp1=a[i];
a[i]=number;
for (j= ------------- ;j<11;j++)
{ temp2=a[j];
---------------- ;
temp1=temp2;
}
break; //解释break在此处的作用
}
}
}
printf("Now array a:\n");
for (i=0;i<11;i++)
printf("%5d",a[i]); //解释蓝色字体程序的作用
return 0;
}
划横线的这些
追答a[10]=number
number<a[i]
i+1
a[j]=temp1;
printf("%5d",a[i]); //解释蓝色字体程序的作用 还有这个
追答该句和for (i=0;i<11;i++)一起表示输出新数组
其中 %d表示把数按十进制整型输出,数字5表示的是输出宽度,即输出的数值如果大于5位,按原数输出,如果小于5位在数的左边补空格。
如果感觉还行 别忘了采纳~~亲
本回答被提问者和网友采纳