roberthsu2003 / cAndC-

51 stars 18 forks source link

c2:計算BMI值 #38

Closed roberthsu2003 closed 3 months ago

roberthsu2003 commented 4 months ago
截圖 2024-05-16 晚上9 31 33
WayneWagin commented 4 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;
}
KKes5566812 commented 4 months ago
#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;
}
jiawzon6234 commented 4 months ago
#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;
}
fatpao commented 4 months ago
#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;
}
jordon1321 commented 4 months ago

``

include

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; } ``

rishisenn commented 4 months ago

include

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; }

lucy0350628 commented 4 months ago
#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;
}
cokoy168 commented 4 months ago
#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;
}
createcube commented 4 months ago
#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;
}
chex5563 commented 4 months ago
/*計算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;
}
Linnn313 commented 4 months ago
#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;
}
KUAN-CHEN0627 commented 4 months ago
#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;
}
charlywang11 commented 4 months ago

計算BMI

#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;
}
Yishuanhsie commented 4 months ago
#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;
}
jack0903215297 commented 4 months ago

#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;
  }
peggypig950913 commented 4 months ago
#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;
}
chang11yu commented 4 months ago
#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;
}
killverybig commented 4 months ago

#include int main(void) { double height , weight ;

printf("請輸入身高(公分) : ");
  scanf("%lf", &height );

printf("請輸入體重(公斤) : ");
  scanf("%lf", &weight );

  printf("BMI公式為: 體重%.2lf / (身高%.2lf)^2 = BMI--> %.2lf <--", weight, height, weight/(height*height/10000));

return 0;

}

965tina commented 4 months ago
#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;
}