
The results

After removing the % 1 f 1, not repeat, but result is still not

If you double the response type to float operation result is the same as the book


CodePudding user response:
Because of you the scanf input is % 1 f, not % lf note you this book should be % lf not % 1 f you wroteYou write the consequence of % 1 f is read only one character at a time the rest into the buffer loop reads will cycle determine output "try again!" This is the reason why few characters output cycle several times
CodePudding user response:
% lf is double-precision floating-point number input is corresponding to the type doubleCodePudding user response:
1 and l