poj2017
简单题
#include <cstdio> int table_len; int total_miles; int main() { while (scanf("%d", &table_len), ~table_len) { int speed, now_time, last_time = 0; total_miles = 0; for (int i = 0; i < table_len; i++) { scanf("%d%d", &speed, &now_time); total_miles += (now_time - last_time) * speed; last_time = now_time; } printf("%d miles\n", total_miles); } return 0; }