“21天好习惯”第一期-2## 标题
今天学习了如何计算体指数
#include <stdio.h>
int main(){ int w,m; float t; printf(“Input weight, height:\n”); scanf("%d,%d",&w,&m); w=w*2; printf(“weight=%d\n”,w); float h=m/100.0; printf(“height=%.2f\n”,h); t=w/h/h/2; printf(“t=%.2f\n”,t); return 0;}
运行结果如下
Input weight, height:
70,174weight=140height=1.74t=23.12--------------------------------Process exited after 8.088 seconds with return value 0请按任意键继续. . .