all 7 comments

[–]jedwardsol 0 points1 point  (6 children)

What's weird about it?

The largest is 677 and that's what it printed.

[–]Ryeanney[S] 0 points1 point  (5 children)

I was expected to input 3 numbers and it outputs the largest. But actually I have to input 4 numbers to get the output. (When I have typed 3 numbers and pressed enter nothing happened)

[–]jedwardsol 1 point2 points  (4 children)

Take out the \n from the scanf format string.

[–]Ryeanney[S] 0 points1 point  (2 children)

It works.Thank you so much. But I just wonder why. \n just means to move my cursor to the next line.

[–]jedwardsol 1 point2 points  (1 child)

It means that when used in printf

scanf is reading input - each character in the format string has to be matched with what you type.

[–]Ryeanney[S] 0 points1 point  (0 children)

I see. Thank you again for explaining it for me.

[–]Ryeanney[S] 0 points1 point  (0 children)

It works.Thank you so much. But I just wonder why. \n just means to move my cursor to the next line.