Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这题真是我不想说了,长度堪比A+BIn 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator