본문 바로가기
python-algorithm

백준 6825 Body Mass Index

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

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

 

6825번: Body Mass Index

The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in metres) and weight (in kilograms), then calculates the BMI using the formula BMI = weight/(height × height).

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def sol(weight, height):
    bmi = weight/(height**2)
    if bmi>25:
        return 'Overweight'
    elif bmi>=18.5:
        return 'Normal weight'
    else:
        return 'Underweight'
 
if __name__ == '__main__':
    weight = float(input())
    height = float(input())
    print(sol(weight, height))
 
cs
반응형

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

백준 26332 Buying in Bulk  (0) 2022.12.22
백준 26531 Simple Sum  (0) 2022.12.22
백준 26340 Fold the Paper Nicely  (0) 2022.12.22
백준 6887 Squares  (0) 2022.12.22
백준 5357 Dedupe  (0) 2022.12.22

댓글