c++ is successfully reading std input