#include<fstream>
#include<iostream>
using namespace std;
int main()
{
int a;
ofstream outfile("myfile.txt",ios::out);
if(!outfile)
{
cerr<<"open error!"<<endl;
exit(1);
}
for(int i=0;i<10;i++)
{
cin>>a;
outfile<<a<<endl;}
outfile.close();
cout<<"处理完毕,请打开文件查看处理结果!"<<endl;
return 0;
}
运行结果: