#include <stdio.h>#include <string.h>#include <map>#include <vector>#include <algorithm>using namespace std;int a[1000];int main(){ int i,j,n,T,s,x,y,z,ans; while(1) { scanf("%d",&n); if (n==-1) break; z=0; ans=0; for (i=0;i<n;i++) { scanf("%d%d",&x,&y); ans+=x*(y-z); z=y; } printf("%d milesn",ans); } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)