Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main(){
- int weight;
- double height,bmi;
- printf("請輸入體重(公斤):");
- scanf("%d",&weight);
- printf("請輸入身高(公尺):");
- scanf("%lf",&height);
- bmi=weight/(height*height);
- printf("BMI:%.2lf\n",bmi);
- if(bmi<18.5)
- printf("體重過輕\n");
- else if(bmi>=18.5&&bmi<24)
- printf("正常範圍\n");
- else if(bmi>=24)
- printf("體重過重\n");
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement