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 chenxuan123456789 at 2012-07-29 19:42:57 on Problem 3632
#include <stdio.h>
int main()
{
	int cases,n,i,j,min,max;
	scanf("%d",&cases);
	while(cases--)
	{
		scanf("%d",&n);
		min=100;
		max=0;
		for(i=1;i<=n;i++)
		{
			scanf("%d",&j);
			if(j>max)
			max=j;
			if(j<min)
			min=j;
		}
		printf("%d\n",(max-min)*2);
	}
	return 1;
}
	

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