题解 | #计算体重指数#

计算体重指数

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

#include <stdio.h>
#include <math.h>

int main() {
    int weight, height_cm;
    scanf("%d %d", &weight, &height_cm);
    float height_m = height_cm / 100.0;
    float bmi = weight / pow(height_m,2);
    printf("%.2f\n", bmi);
    return 0;
}

全部评论

相关推荐

苍蓝星上艾露:这简历。。。可以试试我写的开源简历优化工具https://github.com/weicanie/prisma-ai
点赞 评论 收藏
分享
07-25 13:42
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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