The way it works is, your program is compiled and executed on a remote server, and sends back all the output at once once terminated or it reaches the time limit. Any input has to be given ahead of time.
If you made a mini-menu, I guess you put it in an infinite loop, and you were probably expecting more interactivity than sending everything before your program even asks.
yeah that usually happens with functions which call themselves like
If "x" is very big, even a computer it will give an error related to limited memory