본문 바로가기
python-algorithm

백준 6840 Who is in the middle?

by 무적김두칠 2022. 12. 17.

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

 

6840번: Who is in the middle?

In the story Goldilocks and the Three Bears, each bear had a bowl of porridge to eat while sitting at his/her favourite chair. What the story didn’t tell us is that Goldilocks moved the bowls around on the table, so the bowls were not at the right seats

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
def sol(bears):
 
    return sum(bears) - (max(bears)+min(bears))
 
if __name__ == '__main__':
    bears = []
    bears.append(int(input()))
    bears.append(int(input()))
    bears.append(int(input()))
 
    print(sol(bears))
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 26574 Copier  (0) 2022.12.19
백준 10189 Hook  (0) 2022.12.19
백준 5341 Pyramids  (0) 2022.12.17
백준 26489 Gum Gum for Jay Jay  (0) 2022.12.17
백준 26057 Большой удой  (1) 2022.12.13

댓글