#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
float BMI(float TZ ,float SG )
{
float BMI = TZ / SG / SG;//体质指数计算公式
return BMI;
}
int main()
{
float a = 0;
float b = 0;
float BM = 0;
BM = BMI(a, b);
printf("自制体质指数计算器\n");
printf("请输入您的体重(kg)和您的身高(m)\n");
scanf("%F", &a);//输入体重
scanf("%F", &b);//输入身高
printf("您的体质指数=%f",BM);//输出结果
return 0;
}
上面是代码,输入a,b只会有