成年人消耗卡路里计算:

//成年人消耗卡路里
#include<iostream>

double metabolism(double weight);
double activity(int degree,double weight,int minutes);

int main()
{
    using namespace std;
    double weight,calorie;
    int degree,minutes,n;
    double cal1,cal2;
    
    cout<<"Please input the weight,the degree,the minutes,the calorie of one food:";
    cin>>weight>>degree>>minutes>>calorie;
    
    cal1 = metabolism(weight);
    cal2 = activity(degree,weight,minutes);
    
    n = (cal1 + cal2)/(0.9 * calorie);
    
    cout<<"You need "<<n<<" parts food!"<<endl;
    
    return 0;
}

double metabolism(double weight)
{
    return 70 * (weight/2.2)*0.765;
}

double activity(int degree,double weight,int minutes)
{
    return 0.0385 * degree * weight *minutes;
}

结果:

Please input the weight,the degree,the minutes,the calorie of one food:100 10 10 1000
You need 3 parts food!