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:这题真是我不想说了,长度堪比A+B

Posted by miklcct at 2012-07-26 15:00:22 on Problem 2017
In Reply To:这题真是我不想说了,长度堪比A+B Posted by:Belldandy at 2011-12-04 13:44:38
#include <stdio.h>

int main(void) {
    int n;
    while (scanf("%d", &n) , n != -1) {
        int dist = 0, time = 0;
        while (n--) {
            int a, b;
            scanf("%d%d", &a, &b);
            dist += (b - time) * a;
            time = b;
        }
        printf("%d miles\n", dist);
    }
}

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