一个悲伤的事,为何VC可编译VS不行
# include <stdio.h># include <math.h>
double delta(double a, double b, double c)
{
double delta;
delta = b*b - 4 * a*c;
return delta;
}
int main(void)
{
double a, b, c, x1, x2;
a = 0; b = 0; c = 0;
for (; 1;)
{
scanf("%lf %lf %lf", &a, &b, &c);
double l = delta(a, b, c);
if (l > 0)
{
x1 = (-b + sqrt(l)) / (2 * a);
x2 = (-b - sqrt(l)) / (2 * a);
printf("%lf %lf \n", x1, x2);
}
else if (l == 0)
{
x1 = (-b) / (2 * a);
printf("%lf \n", x1);
}
else
{
printf("无解 \n");
}
}
return 0;
}
代码上面。。
报错下面。。
错误 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.