题解 | #计算体重指数#

计算体重指数

http://www.nowcoder.com/practice/422f6341cf1b4212a7f8c703df111389

#include <stdio.h>
#include <math.h>
int main()
{
	float height = 0;
	float weight = 0;
	scanf("%f %f",&weight,&height);
	float height2 = height / 100.00;
  //因为要保留小数 所以 我们使用float
	printf("%.2f",weight/(height2*height2));
	return 0;
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务