请问下面的程序:
double x;
scanf("%f",&x);
为什么会出错,难道输入double型数据不是用%f吗?还有我在一个枚举类型中声明了一项div,而我又要用到stdlib,结果是变量名冲突,请问有什么方法可以解决?
double x;
scanf("%f",&x);
为什么会出错,难道输入double型数据不是用%f吗?还有我在一个枚举类型中声明了一项div,而我又要用到stdlib,结果是变量名冲突,请问有什么方法可以解决?
E double Identical to the e format except that E rather than e introduces the exponent.
f double Signed value having the form [ – ]dddd.dddd, where dddd is one or more decimal digits. The number of digits before the decimal point depends on the magnitude of the number, and the number of digits after the decimal point depends on the requested precision.
g double Signed value printed in f or e format, whichever is more compact for the given value and precision. The e format is used only when the exponent of the value is less than –4 or greater than or equal to the precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.
G double Identical to the g format, except that E, rather than e, introduces the exponent (where appropriate).