1.C++读取txt文本数据
ifstream infile; string num; int x; infile.open("xxx.txt"); while(infile>>num) { x = atoi(num.c_str()); }