fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(void)
  5. {
  6. int i,n,j,r,s;
  7. static int k=2;
  8.  
  9. scanf("%d",&n);
  10. r=n;
  11. for(i=1;i<=n;i++)
  12. { r=r-1;
  13. for(j=0;j<i;j++)
  14. {
  15. s=r;
  16. while(s--)
  17. {
  18. printf(" ");
  19. }
  20. printf("%5.5d ",(k*(2*k-1)));
  21. k=k+2;
  22.  
  23. }
  24. printf("\n");
  25. }
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 9432KB
stdin
3
stdout
  00006 
 00028  00066 
00120 00190 00276