首页 > 衡量人体胖瘦程度
头像 牛客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 展开全文