| ||||||||||
| 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 | |||||||||
哪位大侠帮帮忙为什么1163Runtime Error明明通过测试#include<stdio.h>
int main(void)
{
int n,i,j,a[100][100];
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
scanf("%d",&a[i][j]);
}
for(i=n-1;i>=0;i--)
{
for(j=0;j<n-1;j++)
{
if(a[i][j]>a[i][j+1])
a[i-1][j]=a[i-1][j]+a[i][j];
else
a[i-1][j]=a[i-1][j]+a[i][j+1];
}
}
printf("%d\n",a[0][0]);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator