#include<iostream>
using namespace std;
int main()
{
const int rate_inch_foot = 12;
const float rate_inch_meter = 0.0254;
const float rate_pound_kg = 2.2;
cout << "Enter the foot your height:___\b\b\b";
int foot,inch,pound;
float meter,kg;
cin >> foot;
cout << "Enter the inch your height:___\b\b\b";
cin >> inch;
cout << "Enter the your weight in pound:___\b\b\b";
cin >> pound;
inch += foot * rate_inch_foot;
cout << "Your height is " << inch << " inches." << endl;
meter = inch * rate_inch_meter;
kg = pound / rate_pound_kg;
cout << "Your BMI is " << kg / meter / meter << endl;
return 0;
}
Exercise 3.2
最新推荐文章于 2023-07-15 21:04:43 发布