头文件#include
ifstream f2("library.txt");
if(!f2)
{
exit(-1);
}
stringstream str;
int id;
string s, s1, s2, s3;
getline(f2, s);
str << s;把s压到str
str>>id>>s1>>s2>>s3;
cout<<id<<"\n"<<s1<<"\n"<<s2<<"\n"<<s3<<endl;
str.clear();//不可少
f2.close();
return 1;