不说啥了。
2017 | Accepted | 240K | 0MS | C++ | 639B |
/*
ID: thestor1
LANG: C++
TASK: poj2017
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <limits>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cassert>
using namespace std;
int main()
{
std::ios::sync_with_stdio(false);
int n, s, t;
while (cin >> n && n != -1)
{
int t0 = 0, dist = 0;
for (int i = 0; i < n; ++i)
{
cin >> s >> t;
dist += s * (t - t0);
t0 = t;
}
cout << dist << " miles" << endl;
}
return 0;
}