Closed roberthsu2003 closed 3 months ago
#include <math.h>
#include <stdio.h>
int main(void) {
double h, w;
printf("請輸入:身高(cm) 體重(kg):");
scanf("%lf %lf", &h, &w);
printf("BMI:%.2f\n", w / pow(h / 100, 2));
return 0;
}
#include <stdio.h>
#include <math.h>
int main(void) {
double Height;
double weight;
double BMI;
printf("Enter your height in meters:");
scanf("%lf", &Height);
printf("Enter your weight in kilograms:");
scanf("%lf", &weight);
BMI = weight / pow(Height/100 , 2);
printf("Your BMI is:%.2lf", BMI);
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight, BMI;
printf("請輸入身高(公分):");
scanf("%lf", &height);
printf("請輸入體重(公斤):");
scanf("%lf", &weight);
height= height/100;
BMI= weight/(height*height);
printf("BMI值為:%.3lf\n", BMI);
return 0;
}
#include <stdio.h>
int main(void) {
double length, weight, BMI;
printf("請輸入身高(公分):");
scanf("%lf", &length);
printf("請輸入體重(公斤):");
scanf("%lf", &weight);
BMI = weight / ((length / 100) * (length / 100));
printf("您的BMI=%.2f\n", BMI);
return 0;
}
``
int main(void) { double weight, height, bmi;
printf("請輸入體重(公斤): "); scanf("%lf",&weight); printf("請輸入身高(公分): "); scanf("%lf",&height); bmi = weight / (height * height); printf("您的BMI值:%.1lf\n", bmi); return 0; } ``
int main(void) { double tall; double weight; double bmi; printf("請輸入身高:\n"); scanf("%lf", &tall ); printf("請輸入體重:\n"); scanf("%lf",&weight); bmi = weight / ((double)tall * tall); printf("bmi: %.2lf\n", bmi);
return 0; }
#include <stdio.h>
int main(void) {
double h,w;
printf("請輸入身高(公分):");
scanf("%lf",&h);
printf("請輸入體重(公斤):");
scanf("%lf",&w);
printf("你的BMI為:%.2lf",w/((h/100)*(h/100)));
return 0;
}
#include <stdio.h>
int main(void) {
int height, wight;
double BMI;
printf("請輸入身高(公分):");
scanf("%d", &height);
printf("請輸入體重(公斤):");
scanf("%d", &wight);
BMI = wight / (height/100.0 * height/100.0);
printf("您的BMI : %.3f\n", BMI);
return 0;
}
#include <stdio.h>
int main(void) {
double height,weight,BMI;
printf("請輸入身高(公分):");
scanf("%lf",&height);
printf("請輸入體重(公斤):");
scanf("%lf",&weight);
BMI=weight/((height/100)*(height/100));
printf("%.2lf",BMI);
return 0;
}
/*計算BMI值
請輸入身高(公分):
請輸入體重(公斤):
BMI值=體重/身高^2*/
#include <stdio.h>
int main(void)
{
double W01, L01, Lm01, BMI01;
printf("算BMI值\n");
printf("請輸入身高(公分)=");
scanf("%lf",&L01);
Lm01=L01/100;
printf("請輸入體重(公斤)=");
scanf("%lf",&W01);
BMI01=W01/Lm01/Lm01;
printf("BMI值=%.3lf\n",BMI01);
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight, bmi;
printf("請輸入身高(公分):");
scanf(" %lf", &height);
printf("請輸入體重(公斤):");
scanf(" %lf",&weight);
bmi = weight /((height/100) * height/100);
printf("您的BMI=%.2lf\n",bmi);
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight, BMI;
printf("請輸入身高(公分):\n");
scanf("%lf",&height);
printf("請輸入體重(公斤):\n");
scanf("%lf",&weight);
BMI = weight / ((height/100)*(height/100));
printf("您的BMI:%.1lf\n",BMI);
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight, bmi;
printf("請輸入身高(公分):");
scanf("%lf", &height);
printf("請輸入體重(公斤):");
scanf("%lf",&weight);
height = height/100;
bmi = weight / (height * height);
printf("您的BMI: %.2lf\n", bmi);
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight,bmi;
printf("請輸入身高(cm):");
scanf("%lf",&height);
printf("請輸入體重(kg):");
scanf("%lf",&weight);
height=height/100;
bmi=weight/(height*height);
printf("您的BMI為:%.3lf",bmi);
return 0;
}
#include<stdio.h>
int main(void){
printf("求bmi(體重/身高*身高)\n");
printf("身高:1.74\n");
printf("體重:62\n");
printf("bmi:%.3lf\n",62/(1.74*1.74));
return 0;
}
#include <stdio.h>
int main(void) {
double Height,Weight,BMI;
printf("請輸入身高(公分):");
scanf("%lf", &Height);
printf("請輸入體重(公斤):");
scanf("%lf", &Weight);
Height=Height/100;
BMI=Weight/(Height*Height);
printf("你的BMI:%.3lf\n",BMI);
return 0;
}
#include<studio.h>
int main(void){
double height , weight , BMI;
printf("請輸入身高(公分) : \n");
scanf("%.2lf ,&height ");
printf("請輸入體重(公斤) : \n");
scanf(%.2lf , &weight);
height=height/100;
BMI=weight/(height*height);
printf("你的BMI為 : %.2lf \n" , BMI);
return0;
}
#include
printf("請輸入身高(公分) : ");
scanf("%lf", &height );
printf("請輸入體重(公斤) : ");
scanf("%lf", &weight );
printf("BMI公式為: 體重%.2lf / (身高%.2lf)^2 = BMI--> %.2lf <--", weight, height, weight/(height*height/10000));
return 0;
}
#include <stdio.h>
int main(void) {
double height, weight, bmi;
printf("請輸入身高(cm):");
scanf(" %lf", &height);
printf("請輸入體重(kg):");
scanf(" %lf",&weight);
bmi = weight /((height/100) * height/100);
printf("您的BMI=%.2lf\n",bmi);
return 0;
}