This should be the problem of data structure.
Under K & RC, the float value is automatically converted to double type before being used as an expression or parameter. ANSI C generally does not automatically convert float to double. Some programs have assumed that the float parameter will be converted to double. In order to protect a large number of such programs, the float parameters of all printf () functions are automatically converted to double types.
As long as the number of data you enter is within the range of float, this data is 0 after being converted into double type in the low-order binary part of memory (that is, the latter part). And this data is placed in the stack, so when reading in %d format, only the last four bytes of data are read, so they are all 0. Enter as many decimal places as possible, such as 1.23456, so that the value is not 0, it is a big number, and it is probably negative.