#include < stdio.h >
#include < stdlib.h >
int main ( )
{
int i, j, t, a[11] = { 1, 2, 3, 5, 6, 7, 8, 9, 10,11 };
scanf ( "%d", &t );
if ( t > a[9] )
a[10] = t;
else
{
for ( i =0; i <10; i++ )
if ( a[i] > t )
{
for ( j=9; i <= j; j-- )
{
a[j+1] = a[j];
}
a[i] = t;break;
//一定要全部后移后再赋值最后才跳出循环
}
}
for ( i = 0; i<11; i++ )
{
printf ( "%5d",a[i]);
}
system ( "pause" );
return 0;
}