C++ 简单的身体健康管理系统

本文介绍了使用C++编程语言开发一个简单身体健康管理系统的过程。该系统涵盖了记录个人健康数据、分析健康趋势和提供健康建议等功能,旨在帮助用户有效管理自己的健康状况。
摘要由CSDN通过智能技术生成
#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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值