#include<stdlib.h> void exit(int status); ///检測文件打开失败 std::ifstream in(file); if(in.fail()){ std::cerr<<"Can't open"<<file<<std::endl; exit(1); }