| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
还需要重写cmp么。。。直接用sort秒过In Reply To:附代码吧!so easy!!! Posted by:chenxuan123456789 at 2012-11-04 21:25:18 #include "iostream"
#include "algorithm"
using namespace std;
#define MAX 10000
int milk[MAX];
int main()
{
int T,i=0;
cin>>T;
for (i=0;i<T;i++)
cin>>milk[i];
sort(milk,milk+T);
int middle=(T-1)/2;
cout<<milk[middle]<<endl;
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator