long count = 0; string str; fstream readf(filePath); while(getline(readf,str)) { count++; cout<<count<<" "<<str<<endl; }
相互帮助