- import java.io.*;
- import java.util.*;
- public class Main
- {
- static ArrayList<Integer> arrays = new ArrayList<Integer>();
- public static void main(String[] args) throws Exception
- {
- readFile();
- }
- static void readFile() throws Exception
- {
- BufferedReader br = new BufferedReader(
- new FileReader("in.in"));
- //new InputStreamReader(System.in));
- int n = Integer.parseInt(br.readLine());
- int count = 0;
- while(count<n)
- {
- arrays.add(Integer.parseInt(br.readLine()));
- count++;
- }
- Collections.sort(arrays);
- System.out.print(arrays.get(n/2));
- }
- }
http://acm.pku.edu.cn/JudgeOnline/problem?id=2388 简单题
很简单很简单题