(백준) 최소,최대

김주현·2021년 8월 20일

또 하나 알아버렸다! (매우 기초적인 것들 쉿...)

https://www.acmicpc.net/problem/10818

a = int(input())
cnt = list(map(int,input().split()))

max_cnt = cnt[0]
min_cnt = cnt[0]
for n in cnt:
    if n > max_cnt:
        max_cnt = n
    if n < min_cnt:
        min_cnt = n

print(max_cnt,min_cnt)

-----------------------------------------------------

listmap함수를 통해서 불러 오는것 첨 알았다. ㅎㄷㄷ
분명 어딘가 봤고 썼을텐데 몸으로 체감하기 까지 이렇게 오래 걸릴 줄이야 이야;;;; 
많은 인수들을 어떻게  받을지 고민했다.. (기초 쉿...)

리스트들을 받은 것들을 max,min [0]을 통해 첫번째부터 for 을 통해 if문 
쉬운문제 하지만 list(map(int,input().split()) 잃어 버지리 말자

profile
잼민이개발자

0개의 댓글