| ||||||||||
| 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 | |||||||||
在自己的机器上很对啊 为什么总是Runtime Error?C语言的:
#include<stdio.h>
#include<stdlib.h>
main()
{
int n,i,j;
int **d;
scanf("%d",&n);
d=malloc(n*sizeof(int *));
for(i=0;i<n;i++)
{
d[i]=malloc(i*sizeof(int));
for(j=0;j<=i;j++)
scanf("%d",&d[i][j]);
}
for(i=n-2;i>=0;i--)
for(j=0;j<=i;j++)
d[i][j] += d[i+1][j]>d[i+1][j+1]?d[i+1][j]:d[i+1][j+1];
printf("%d\n",**d);
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator