杨辉三角
#include<stdio.h>
int main()
{
int m = 0;
int l = 0;
int arr[6][6] = { 0 };
for (m = 0; m<6; m++)
{
arr[m][m] = 1;
arr[m][0] = 1;
}
for (m = 2; m<6; m++)
{
for (l = 1; l <= m - 1; l++)
{
arr[m][l] = arr[m - 1][l - 1] + arr[m - 1][l];
}
}
for (m = 0; m<6; m++)
{
for (l = 0; l <= m; l++)
{
printf("%6d", arr[m][l]);
}
printf("\n");
}
return 0;
}