楼上的以为我傻的啊
#include <stdio.h>
int main (void)
{
int i,j,n,k;
printf("Enter n(n<=9):");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
k=1;
for(j=0;j<n+i;j++)
j<=n-i?printf(" "):j<n?printf("%2d",k++):printf("%2d",k--);
printf("\n");
}
printf("\n");
}