为什么我这个打完会有这个东西
#include<stdio.h>
int main()
{
float x, y;
scanf_s("%.lf", &x);
if (x == 0)
y = 0;
else
y = 1.0 / x;
printf("f(%.1f) = %.1f", x, y);
return 0;
}
scanf_s("%lf", &x);
if (x != 0)
{
result = 1.0 / x;
}
else
{
result = 0.0;
}
printf("f(%.1f) = %.1f\n", x, result);
return 0;
}
float 是用%f
double 是 %lf