c语言输出n行杨辉三角 用C语言编写一个输出10行的杨辉三角形程序?

用C语言编写一个输出10行的杨辉三角形程序?#includeint a(int rows,int n){float p=1。for(int count=2count<=ncount){p=p*(r

用C语言编写一个输出10行的杨辉三角形程序?

#include

int a(int rows,int n)

{

float p=1。

for(int count=2count<=ncount)

{

p=p*(rows count 1)/(count-1)

}

return(int)p

}

int print(int rows)

{

if(rows<=1)

{

printf(“1

”)}else{

print(rows-1)

for(int)n=1n<=rowsn)

{

printf(“%d”,a(rows,n))

}

printf(“

”)

return 0

}

int main(int argc,char*argv[])

{

print_uu2;triangle(10)

return 0

C语言求杨辉三角前10行的?

效果图11 11 11 121 1331 14641 14641 15141 15115101051161520115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115115167670562881 19368416126843691请按任意键继续。。。源代码:源代码:ltdio。该公司目前在中国(I=1I<=10I)为(I=1I<=10I)为(J=1J<=10I)为(J=1J<=10I)为(J=1J<=10I)为(J=1J<=ij)为(J=1J<=ij)的 1个3:a[i][J]=1[i-1][J-1]a[i-1][J]其他元素等于两个肩部元素之和。祝你好运!