#include<stdio.h> int main() { float m, h, a, BMR, n; printf("请输入你的体重m(kg):"); scanf_s("%f", &m); printf("请输入你的身高h(cm):"); scanf_s("%f", &h); printf("请输入你的年龄a:"); scanf_s("%f", &a); BMR = 66 + (6.3 * m * 2.2) + (12.9 * h * 0.39) - (6.8 * a); printf("你的代谢率为%lf", BMR); n = BMR / 230.000000; printf("你所需要吃的巧克力块数为%lf",n); }
标签:lf,巧克力,需要,scanf,BMR,体重,printf From: https://www.cnblogs.com/blog-of-zhh/p/16754558.html