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????#include<iostream> using namespace std; int main() { int n,i,j,a[100][100]; cin>>n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { cin>>a[i][j]; } } for(i=n-1;i>=1;i--) { for(j=1;j<=i;j++) { a[i][j]=((a[i][j]+a[i+1][j])>(a[i][j]+a[i+1][j+1]))? (a[i][j]+a[i+1][j]):(a[i][j]+a[i+1][j+1]); } } cout<<a[1][1]<<endl; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator