题解 | #计算体重指数#

计算体重指数

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

#include<stdio.h>

int main()
{
    int weight = 0;
    int height = 0;
    scanf("%d %d", &weight, &height);
    float BMI = 0.0f;
    float height_m = height/100.0;
    BMI = weight/(height_m * height_m);
    printf("%.2f", BMI);

    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务