Q:
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
#include
#include
void main()
{
int i,j,k,n=9;
for(i=1;i<=n;i++) { for (j=1; j<=n-i; j++) putchar(' '); for (j=1,k=2*i-1; j<=2*i-1; j++,k--) { if (j <= k) printf("%d", j); else printf("%d", k); } putchar('\n'); } getch(); }
No comments:
Post a Comment