C语言编程输出杨辉三角形(要求输出10行)简介 #include<stdio.h>int main(){int n,i,j,a[100];n=10;printf(" 1");printf("\n");a[1]=a[2]=1;printf("%3d%3d\n",a[1],a[2]);for(i=3;i<=n;i++){a[1]=a[i]=1;for(j=i- 正文 1 #include<stdio.h>int main(){int n,...
include<stdio.h>int main(){int n;printf("输入行数:");while(scanf("%d",&n)!=EOF){int a[31][31];int i,j,k;for(i=1;i<=30;i++)a[i][1]=a[i][i]=1;if(n==1)printf("1\n");if(n>=2)printf("1\n1 1\n");for(i=3;i<=n;i++){printf("1 ");for(...
include <stdio.h> int main(){ int i=0,j=0,a[6][6]={{0}};for (i=0;i<6;i++)a[i][0]=a[i][i]=1;for (i=2;i<6;i++)for(j=1;j<i;j++)a[i][j]=a[i-1][j-1]+a[i-1][j];for (i=0;i<6;i++){ for (j=0;j<=i;j++)printf("%5d",a[i]...