Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这题真是我不想说了,长度堪比A+B

Posted by Belldandy at 2011-12-04 13:44:38 on Problem 2017
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator