首页
比赛
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
衡量人体胖瘦程度
31条解析
开通博客写题解
牛客171676524号
发表于 2021-09-27 20:39:23
两个坑: 1.求bmi的时候,没说保留的格式,在中间计算过程种,不要round,否则不准 2.在判断的时候,先用小区间,else的时候为大区间,免得溢出问题 lines=[] while True: try: lines.append(input()) exce
展开全文
我也要当学霸
发表于 2022-03-01 17:45:08
#include <stdio.h> void sum(int zhong,int gao) //定义一个函数用来计算 { double a = 0; a = zhong / (gao * gao / 10000.0); //计算BMI值并把它存在变量a中 if (a <
展开全文
苑显瑞
发表于 2021-10-14 18:48:21
#include<stdio.h> int main() { int a,b; float c; float BMI(int weight,int high); while(scanf("%d%d",&a,&b)!=EOF) {
展开全文
诗奕
发表于 2024-01-05 20:16:28
#include <stdio.h> int main() { float a, b, BMI = 0.0; while (scanf("%f %f", &a, &b) != EOF) { BMI = a/(b*b/1
展开全文
Portia356
发表于 2021-11-18 11:04:05
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in);
展开全文
梦妤
发表于 2022-02-12 18:40:12
注意题目中的BMI=weight/(hight*hight)其中单位分别是kg和m。 #include<stdio.h> int main() { int a,b; flo
展开全文
牛客609187604号
发表于 2022-01-29 11:49:38
#include<stdio.h> #include<string.h> int main() { float weight , height , b , bmi(int , int); while(scanf("%f %f", &weight,&height
展开全文
西西西西西西西
发表于 2021-09-02 21:29:47
#include <stdio.h> #include <math.h> int main() { int w = 0; int h = 0; double bmi = 0.0; //多组输入 while (~scanf("
展开全文
牛客题解官
发表于 2020-06-04 16:19:02
分析: 本题的坑在于未给出BMI计算公式,查阅资料之后BMI=weight/(height*height),注意单位是米和kg,对于计算出来的BMI,进行区间判断即可。 题解: #include <bits/stdc++.h> using namespace std; int main
展开全文
孤叶123
发表于 2021-11-13 14:05:36
#include <stdio.h> int main() { int x = 0; int y = 0; double a = 0; double b = 0; while (scanf("%d %d", &x, &y) != EOF) { b = y / 10
展开全文
查看本题
查看本题讨论
相关比赛
335-编程语言初学练习赛(第三场)
进入比赛
2350-2.1 选择结构
进入比赛
6632-牛客编程语言练习赛第十场
进入比赛
7118-牛客编程语言练习赛第十场(重现赛)@vito0210
进入比赛
7258-牛客编程语言练习赛第十场(重现赛)@vito0210
进入比赛
等你来战
查看全部
牛客练习赛139
报名截止时间:2025-05-23 21:30
牛客周赛 Round 94
报名截止时间:2025-05-25 21:00
牛客2025年儿童节比赛
报名截止时间:2025-06-01 21:00
衡阳师范学院第二十五届程序设计竞赛(同步赛)
报名截止时间:2025-06-08 18:00
2025牛客暑期多校训练营1
报名截止时间:2025-07-15 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题