---
title: "打印杨辉三角10"
author: "chenchuxin"
date: "2008-03-18T19:08:50Z"
tags: []
slug: "10"
draft: false
lastmod: "2008-03-18T19:08:50Z"
id: 173494
url: "https://chenchuxin.iteye.com/blog/173494"
---

```c

main() 
{
int i,j; 
int a[10][10]; 

printf("\n"); 
for(i=0;i<10;i++) 

{a[i][0]=1; 
a[i][i]=1;} 

for(i=2;i<10;i++) 
for(j=1;j<i;j++) 

a[i][j]=a[i-1][j-1]+a[i-1][j]; 

for(i=0;i<10;i++) 

{for(j=0;j<=i;j++) 

printf("%5d",a[i][j]); 
printf("\n"); 
getch();
} 
}

```