#include <iostream>
#include <fstream>
using namespace std;
int main()
{
//输入
int a[10];
ofstream outfile1("f1.dat"), outfile2("f2.dat");
cout<<"输入5个数"<<endl;
for(int i=0; i<5; i++)
{
cin>>a[i];
outfile1<<a[i]<<" ";
}
cout<<"输入5个数"<<endl;
for(int i=0; i<5; i++)
{
cin>>a[i];
outfile2<<a[i]<<" ";
}
outfile1.close();
outfile2.close();
//放到f2后面
{
ifstream infile("f1.dat");
ofstream outfile("f2.dat",ios::app);
int k;
for(int i=0; i<5; i++)
{
infile >> k;
outfile<<k<<" ";
}
infile.close();