| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
无论怎么样都是 out put limit exceed 我是受不了了,高手在哪?#include <stdio.h>
#include <math.h>
void main (){
int a[100][100];
int i,j,n;
scanf ("%d",&n);
while (n>=1){
for (i=1;i<=n;i++){
a[i][1]=1;
a[i][i]=1;
}
if (n>=3){
for (i=3;i<=n;i++){
for (j=2;j<=i-1;j++)
a[i][j]=a[i-1][j]+a[i-1][j-1];
}
}
for (i=1;i<=n;i++){
for (j=1;j<=i;j++)
printf ("%d ",a[i][j]);
printf ("\n");
}
scanf ("%d",&n);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator