Create 1718.c

This commit is contained in:
KiritoTRw 2016-04-28 08:12:17 +08:00
parent d1714d263b
commit 7ce1de7ae1

36
QUSTOJ/1718.c Normal file
View File

@ -0,0 +1,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int dx[32][32];
#define MAXN 20
void calc()
{
dx[1][1]=1;
for(int i=2;i<=MAXN;i++)
{
for(int j=1;j<=i;j++)
{
dx[i][j]=dx[i-1][j-1]+dx[i-1][j];
}
}
}
int main()
{
calc();
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
printf("%d ",dx[i][j]);
}
printf("\n");
}
return 0;
}