http://codeup.kr/problem.php?id=1229
Codeup 1229 - 비만도 측정 2
int main(void)
{
double height, weight;
double stdWeight = 0;
double bmi = 0;
scanf("%lf %lf", &height, &weight);
if (height < 150)
{
stdWeight = height - 100;
}
else if (height < 160)
{
stdWeight = (height - 150) / 2 + 50;
}
else
{
stdWeight = (height - 100) * 0.9;
}
bmi = (weight - stdWeight) * 100 / stdWeight;
if (bmi <= 10)
{
printf("정상\n");
}
else if (bmi <= 20)
{
printf("과체중\n");
}
else
{
printf("비만\n");
}
return 0;
}
'알고리즘 문제 풀기 > Codeup' 카테고리의 다른 글
Codeup 1231 - 계산기 1 (0) | 2019.01.01 |
---|---|
Codeup 1230 - 터널 통과하기 2 (0) | 2018.12.31 |
Codeup 1228 - 비만도 측정 1 (0) | 2018.12.31 |
Codeup 1226 - 이번 주 로또 (0) | 2018.12.30 |
Codeup 1224 - 분수 크기 비교 (0) | 2018.12.30 |