1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9
-----------------------------------------------------------------------------------------------------------------------------
#include <stdio.h>
int main()
{
int rows=8,i,j,space,coef=1;
for (i = 0; i <=rows; i+=2) {
for (space = 2; space <= rows-i+3; space++)
printf(" ");
for (j =0; j <= i; j++) {
if (j == 0 || i == 0)
coef = 1;
else
coef = coef+1;
printf("%4d", coef);
}
printf("\n");
}
return 0;
}
Comments
Post a Comment