文章
34
粉丝
316
获赞
10
访问
22.4k
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
while (n!=0)
{
int a[20][20] = { 0 };
for (int i = 0; i < n; i++) a[i][0] = 1;
for (int i = 1; i < n; i++)
for (int j = 1; j < n; j++)
a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
if (a[i][j]) printf("%d ", a[i][j]);
printf("\n"...
登录后发布评论
暂无评论,来抢沙发