PHP小丑 发表于 2021-12-25 16:28:19

BC25 计算体重指数


#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;
}


https://blog.51cto.com/u_15460718/4839513
页: [1]
查看完整版本: BC25 计算体重指数