二维数组 和 杨辉三角形
#include "stdio.h"
# define m 10
int main()
{
int n;
int i;
int a[m][m];
for (i = 0; i < m; i++)
{
for (n = 0; n <= i; n++)
{
if (n == 0)a[i][n] = 1;
else if (n == i)a[i][n] = 1;
else
a[i][n] = a[i - 1][n - 1] + a[i - 1][n];
}
}
int v, k;
for (v = 0; v < m; v++)
{
for (k = 0; k <= v; k++)
printf("%d ", a[v][k]);
printf("\n");
}
return 0;
}