评论

收藏

[C++] BC25 计算体重指数

编程语言 编程语言 发布于:2021-12-25 16:28 | 阅读数:232 | 评论:0

DSC0000.png
#include<stdio.h>
/*
int main()
{
  double BMI=0.0;
  int high=0;
  int weight=0;
  scanf("%d %d",&weight,&high);
  //cm->m
   high=(float)high/100;
  BMI=weight/(high*high);
  printf("%.2lf",BMI);
  return 0;
}
*/
int main()
{
  double BMI=0.0;
  int high=0;
  int weight=0;
  scanf("%d %d",&weight,&high);
  //cm->m
  BMI=weight/((double)high*high/10000);
  printf("%.2lf\n",BMI);
   return 0;
}

关注下面的标签,发现更多相似文章