#include
#include
#include
#include
using namespace std;
int main()
{
ifstream in(“DATA5612.CPP”);//读文件
ofstream out(“DATA5612.TXT”);//写入文件
string line;
int lineNumber = 1;
while(getline(in,line))
{
out <<setfill(‘0’)<<setw(4)<< lineNumber++ << " " << line << endl;//格式为0001
}
in.close();
out.close();
return 0;
}