65,186
社区成员




#include <iostream>
#include <fstream>
using namespace std;
void main()
{
char ch[100];
int i=0;
fstream file1,file2;
file1.open ("1.txt",ios::in);
file2.open ("OUTPUT.txt",ios::out);
while(!file1.eof())
{
file1.getline(ch,100);
char p[256]={0};
sprintf(p,"第%d行 %s\n",i+1,ch);
i++;
file2.write(p,strlen(p));
}
file2.close();
file1.close();
}