[Zhengqing] [1764] BMI

Problem Description

Loading...

Problem Analysis

Simple variable calculation
Nothing much to say~

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#include<stdio.h>
int main() {
	double m,kg,BMI;
	scanf("%lf %lf",&m,&kg);
	BMI=kg/(m*m);
	if(BMI>24.99)
		printf("偏胖\n");
	else if(BMI<18.5)
		printf("偏瘦\n");
	else
		printf("正常\n");
	return 0;
}

Problem link: 【ZZULI】[1764]BMI

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...