自己写了个程序:
#include <iostream>
#include <windows.h>
#include <fstream>
#include <cstring>
#include <string>
using namespace std;
string a[1001],b[1001];
int main(){
freopen("1.txt","r",stdin);
cout<<"正在读取文档1的内容……\n";
for(int i=1;i<=78;i++){
getline(cin,a[i]);
//cout<<a[i]<<endl;
}
system("cls");
cout<<"正在关闭文档……\n";
fclose(stdin);
system("cls");
freopen("2.txt","r",stdin);
cout<<"正在读取文档2的内容中……\n";
for(int i=1;i<=150;i++){
getline(cin,b[i]);
}
system("cls");
cout<<"正在关闭文档……\n";
fclose(stdin);
system("cls");
cout<<"正在组合文档……\n";
freopen("3.txt","w",stdout);
for(int i=1;i<=150;i++){
cout<<a[i]<<" // ";
cout<<b[i]<<endl;
}
system("cls");
fclose(stdout);
cout<<"正在关闭文档……\n";
system("cls");
cout<<"项目完成!\n";
//*/
return 0;
}
运行后:
大家可以帮忙吗?万分感谢。