#include
int main() {
int a[11] = {2,4,6,9,13,16,19,28,40,100},x,t1,t2,i,j;
for(i = 0;i < 10;i++) printf("%5d",a[i]);
printf("\n");
scanf("%d",&x);
for(i = 0;i < 10;i++)
if(a[i] > x) { //当比较后知道x t1 = a[i];
a[i] = x;
for(j = i + 1; j < 11;j++) { // t1放到x的后边,余下的数全部后移一个位置
t2 = a[j];
a[j] = t1;
t1 = t2;
}
break;//如果这个x大于100,则不做处理
}
for(i = 0;i < 11;i++)
printf("%5d\n",a[i]);
return 0;
}