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:我的为什么老是wrong answer

Posted by cuiwj871128 at 2008-10-26 15:13:46 on Problem 2017
In Reply To:我的为什么老是wrong answer Posted by:2006011415 at 2007-02-28 10:39:44
> #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