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

无聊

Posted by pig8310 at 2007-03-27 14:51:40 on Problem 2017
#include "stdio.h"
void main()
{
	int s[11],t[11],l;
	int n,i;
	while(1)
	{
		l=0;
		scanf("%d",&n);
		if(n==-1)break;
		for(i=0;i<n;i++)
		{
			scanf("%d%d",&s[i],&t[i]);
		}
		for(i=0;i<n;i++)
		{
			if(i==0)l+=s[i]*t[i];
			else l+=s[i]*(t[i]-t[i-1]);
		}
		printf("%d miles\n",l);
	}
}






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