首页 > 其他 > 详细

成年人消耗卡路里

时间:2014-08-31 02:52:41      阅读:294      评论:0      收藏:0      [点我收藏+]

成年人消耗卡路里计算:

//成年人消耗卡路里
#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!


成年人消耗卡路里

原文:http://9320314.blog.51cto.com/9310314/1546922

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!