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

60题水过纪念,不用再来写这里代码直接贴

Posted by 20084858 at 2009-10-31 12:39:56 on Problem 3325
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,a[100],i,sum,t;
	while(cin>>n&&n)
	{
		sum=0;
		t=0;
		memset(a,0,sizeof(a));
		for(i=0;i<n;i++)
			cin>>a[i];
		sort(a,a+n);
		for(i=1;i<n-1;i++)
			sum=sum+a[i];
		t=sum/(n-2);
		cout<<t<<endl;
	}
	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