首页 > 代码库 > 成年人消耗卡路里
成年人消耗卡路里
成年人消耗卡路里计算:
//成年人消耗卡路里 #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!
成年人消耗卡路里
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。