#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int N;
int arr[500][500] = { 0 };
scanf("%d", &N);
printf("1\n");
arr[0][1] = 1;
for (int i = 1; i < N; i++)
{
for (int j = 1; j <= (i+1); j++)
{
arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
printf("%d ", arr[i][j]);
}
printf("\n");
}
return 0;
}
C语言_简单杨辉三角_代码实现
最新推荐文章于 2024-08-12 11:16:58 发布