Q : Main loop and error input

(clear may not work)