Home > Back-end >  Results the content of the print will repeat according to input character? Why don't type doubl
Results the content of the print will repeat according to input character? Why don't type doubl

Time:11-30



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 wrote
You 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 double

CodePudding user response:

1 and l
  • Related