#include <iostream>
using namespace std;
int main() {
// Variables to store user input
int age, height, weight;
// Ask the user for their age, height, and weight
cout << "Please enter your age: ";
cin >> age;
cout << "Please enter your height in inches: ";
cin >> height;
cout << "Please enter your weight in pounds: ";
cin >> weight;
// Calculate BMI
double bmi = (double)weight / ((double)height * (double)height) * 703;
// Calculate and output BMI category
if (bmi < 18.5) {
cout << "Your BMI is " << bmi << " and you are underweight." << endl;
} else if (bmi >= 18.5 && bmi < 25) {
cout << "Your BMI is " << bmi << " and you are of normal weight." << endl;
} else if (bmi >= 25 && bmi < 30) {
cout << "Your
C++ 简单的身体健康管理系统
最新推荐文章于 2024-08-09 10:25:03 发布
本文介绍了使用C++编程语言开发一个简单身体健康管理系统的过程。该系统涵盖了记录个人健康数据、分析健康趋势和提供健康建议等功能,旨在帮助用户有效管理自己的健康状况。
摘要由CSDN通过智能技术生成