小学生c++编程资料
链接:https://pan.baidu.com/s/1FfOirxJ9rrY7rxtHUM4W_A
提取码:uqm9
#include<iostream> using namespace std; int main() { float height,weight,bmi; cout<<"身体(米):"; cin>>height; cout<<"体重(公斤):"; cin>>weight; bmi=weight/(height*height); if(bmi<18.5) cout<<"偏瘦"; else if(bmi<24) cout<<"正常"; else if(bmi<28) cout<<"偏胖"; else if(bmi<40) cout<<"肥胖"; else cout<<"极重度肥胖"; return 0; }
原文地址:https://www.cnblogs.com/kixiaoyuan/p/12695065.html
时间: 2024-09-29 21:33:51