1: #include "stdio.h"
2:
3: int main()
4: {
5: int i, j, k, buf[7], tmp[7];
6:
7: for (i=0; i<=6; ++i)
8: {
9: if (i == 0)
10: printf("%d", 1);
11: else if(i == 1)
12: {
13: printf("\n%d %d\n",1,1);
14: buf[0] = 1;
15: buf[1] = 1;
16: }
17: else
18: {
19: for (j = 1; j <= i+1; ++j)
20: {
21: if (j == 1 || j == i+1)
22: {
23: printf("%d ", 1);
24: tmp[j-1] = 1;
25: }
26: else
27: {
28: printf("%d ", buf[j-2] + buf[j-1]);
29: tmp[j-1] = buf[j-2] + buf[j-1];
30: }
31: }
32: printf("\n");
33: for (k = 0; k < 7; ++k)
34: {
35: buf[k] = tmp[k];
36: }
37: }
38: }
39: return 0;
40: }