add flush before reading input for Windows msys2/mingw merged-on-behalf-of: Petar Kirov <PetarKirov@users.noreply.github.com>