fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. float h=0,w=0,BMI=0;
  6. scanf("%f %f",&h,&w);
  7. BMI=w/(h*h);
  8. if(BMI<18.5)
  9. printf("偏瘦");
  10. if(BMI>=18.5&&BMI<=24.0)
  11. printf("正常");
  12. if(BMI>=24.0)
  13. printf("有点重");
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5288KB
stdin
1.75 65
stdout
正常