#include<stdio.h>
#define HEG 0.54
float height(float father, float mother);
int main()
{
float father;
float mother;
float son;
printf("请输入父亲的身高:\n");
scanf("%f", &father);
printf("请输入母亲身高:\n");
scanf("%f", &mother);
son = height(father, mother);
printf("预判儿子身高");
printf("%.2f\n", son);c
return 0;
}
float height(float father, float mother)
{
float son = (father + mother) * HEG;
return son;
}
1>C:\Users\Administrator\Desktop\C语言\Project1\Project1\hello.c(12,1): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1274): message : 参见“scanf”的声明
1>C:\Users\Administrator\Desktop\C语言\Project1\Project1\hello.c(15,1): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1274): message : 参见“scanf”的声明
1>C:\Users\Administrator\Desktop\C语言\Project1\Project1\hello.c(25,1): warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
1>已完成生成项目“Project1.vcxproj”的操作 - 失败。