出现 error C2065: 'getch' : undeclared identifier的解决方法: 包含头文件加一个conio.h #include <conio.h> 或者把getch 这个函数改成 getchar函数。 就可以了,我的运行环境是VC++6.0