(1) qtcreator-->左側Projects-->Run-->中間的checkbox (Run in terminal)打上勾terminal
(2) 在項目的.pro文件中加上 "CONFIG += console"qt