#include<fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
ifstream fin;
string a;
fin.open("StudentInformation.txt");
while(!fin.eof())
{
fin >> a;
cout << a << endl;
}
return 0;
}
为什么这样做,文件中的最后一个元素会再重复输出一遍啊?
求大侠指教啊!!!
没分了不好意思···