标签:http system use for sys col info i++ src
在屏幕上打印杨辉三角
#include<stdio.h>
int main()
{
int arr[100][100] = { 0 };
int i = 0;
int j = 0;
for (i = 1; i < 10; i++)
{
for (j = 1; j < 10; j++)
{
if (j == 0)
{
arr[i][j] = 1;
}
if (i == j)
{
arr[i][j] = 1;
}
if (i > 1 && j > 0)
{
arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
}
}
}
for (i = 1; i < 10; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
system("pause");
}
标签:http system use for sys col info i++ src
原文地址:https://www.cnblogs.com/yishengPan/p/9035546.html