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

第一次一次过!

Posted by 20124233 at 2014-05-11 20:31:43 on Problem 2017
#include<iostream>
 using namespace std;
 int b[1000];
  int main(){
    int m,sum,a;
    while(cin>>m){
      if(m==-1)break;
      sum=0;
      for(int i=1;i<=m;i++){
      	cin>>a>>b[i];
        sum+=a*(b[i]-b[i-1]);
      }
      cout<<sum<<" miles"<<endl;
    }
  } 

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