7.중간값

CS/Try-cat.ch 쉬움 2016. 2. 16. 17:23

문제:

풀이:

#-*-incoding:utf-8-*-
#python

cnt=input()
arr=raw_input()

splt=arr.split()

for i in range (cnt): #str을 int형으로
        splt[i]=int(splt[i])

splt.sort() #오름차순 정렬
mid=int(cnt/2)+1 #가운데 인덱스를 구해준다.

print splt[mid-1]


'CS > Try-cat.ch 쉬움' 카테고리의 다른 글

9.온도 단위 변환  (0) 2016.02.16
8.단어 뒤집기  (0) 2016.02.16
6.2등  (0) 2016.02.16
5.글자 갯수 세기  (0) 2016.02.16
4.완전제곱수  (0) 2016.02.16
Tags
Social