33,311
社区成员
发帖
与我相关
我的任务
分享
#include"fstream"
#include"sstream"
#include"iostream"
#include"string"
using namespace std;
void main()
{
ifstream file1;
file1.open("c:\1.txt");
if(file1.fail())
{
cout << "File open error!";
exit(1);
}
while(!file1.eof())
{
ostringstream oss;
char tmp[100];
file1.getline(tmp,100);
oss <<tmp<<"/t"<<"I love you"<<endl;
}
file1.close();
}