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

Re:水题,没人发贴 顶一下

Posted by qylsw at 2010-07-18 09:14:33 on Problem 3325
In Reply To:水题,没人发贴 顶一下 Posted by:liangyifeng_rjxy at 2007-09-14 16:36:12
> .....
#include<iostream>
using namespace std;
int main()
{
	int n;
	while(scanf("%d",&n)&&n!=0){
		int i,a[1000],sum=0,min=1000000,max=0;
		for(i=0;i<n;i++){
			scanf("%d",&a[i]);
			sum+=a[i];
			if(a[i]>max) max=a[i];
			if(a[i]<min) min=a[i];
		}
		sum=sum-max-min;
		sum/=(n-2);
		printf("%d\n",sum);
	}
	return 0;
}

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