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

万恶的主啊,sort一把了,sort代码

Posted by ACM_Hohai at 2008-11-04 16:01:13 on Problem 2388
#include<iostream>
#include<algorithm>

using namespace std;

int data[10001];

int main()
{
    int cyle,i=0;
    cin>>cyle;
    while(cyle--) {
        scanf("%d",&data[i++]);
    }
    sort(&data[0],&data[i]);
    cout<<data[i/2]<<endl;
    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