| ||||||||||
| 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 | |||||||||
大牛帮忙,想了好久认为是对的,但结果却相反,为什么?#include <iostream>
using namespace std;
int d[101][101]={0};
void main()
{
int n;
cin>>n;
int i,j;
for (i=0;i<n;i++)
for (j=0;j<=i;j++)
cin>>d[j][i];
for (i=n-1;i>0;i--)
for (j=0;j<i;j++)
d[i-1][j]+=d[i][j]>d[i][j+1]?d[i][j]:d[i][j+1];
cout<<d[0][0]<<endl;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator