#include <stdio.h>
#include <conio.h>
main()
{int j,i=0,n,a[11]={12,13,16,19,23,26,29,36,39,45,49};
int *p,*q;
printf("input n=");
scanf("%d",&n);
if(n>=a[10])a[10]=n;
while(n>=a[i])++i;
q=a+i;
for(p=a+9;p>=q;--p)*(p+1)=*p;
*q=n;
for(j=0;j<11;j++)printf("%3d",a[i]);
}
#include <conio.h>
main()
{int j,i=0,n,a[11]={12,13,16,19,23,26,29,36,39,45,49};
int *p,*q;
printf("input n=");
scanf("%d",&n);
if(n>=a[10])a[10]=n;
while(n>=a[i])++i;
q=a+i;
for(p=a+9;p>=q;--p)*(p+1)=*p;
*q=n;
for(j=0;j<11;j++)printf("%3d",a[i]);
}
[此贴子已经被作者于2006-12-6 20:31:19编辑过]