When I am using GoLand to run my program, everything works fine, just like what I expected. But, my program does not work well when I try to manually run it in CMD terminal.
The command line I used to run my program was “go run c.go” where c.go is my source file.
Here is the correct result from GoLand:
Where the green numbers are the inputs from stdin.
Meanwhile with the terminal:
Any help? Thank you!
Full Code in Playground