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

我的为什么老是wrong answer

Posted by 2006011415 at 2007-02-28 10:39:44 on Problem 2017
#include<iostream>
using namespace std;
int main()
{
	int n=0;int a[11][3];int sum=0,d=0;
do{
	cin>>n;
	if(n!=-1){
for(int j=1;j<=n;j++)
{

		cin>>a[j][1]
			>>a[j][2];

}for(j=2;j<=n;j++)
{d=a[1][1]*a[1][2];
	sum=sum+a[j][1]*(a[j][2]-a[j-1][2]);
}
cout<<sum+d<<" "<<"miles"<<endl;
sum=0;
	}}while(n!=-1);
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