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 |
这题真是我不想说了,长度堪比A+B#include<stdio.h> int main() { int n=0,i=0,sum=0,a=0,b=0,c=0; while(scanf("%d",&n)&&n>0) { sum=0; c=0; for(i=0;i<n;i++) { scanf("%d%d",&a,&b); sum+=a*(b-c); c=b; } printf("%d miles\n",sum); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator