loveyan
#include //定义一个输出文件对象
ofstream output; //ofstream ifstream 是fstream的两个子类 output file stream input file stream
//Create a file
output.open("scores.txt");
//Write two lines
output <<"Love" <<" " <<"yan" <<" " << 90 << endl;
output <<"I'm" <<" " <<"Haozi" <<" " <<99;
output.close();
cout<< "Complete"<<endl;
return 0;
<blockquote>
Loveyan
}