Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为什么是Runtime Error????

Posted by Demon516 at 2010-12-22 18:41:40 on Problem 1163
In Reply To:为什么是Runtime Error???? Posted by:Demon516 at 2010-12-22 11:25:46
> #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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator