#include<iostream>
#include<vector>
#include<algorithm>
#include<fstream>
using namespace std;
void function(string c, string a, string b);
int main() {
function("c.txt", "a.txt", "b.txt");
}
void function(string c, string a, string b)//分别为输入文件名,输出文件名,输出文件名
{
ifstream z;
z.open(c);
ofstream x(a);
ofstream y(b);
istream_iterator<int>in_iter(z), eof;
vector<int>vec(in_iter, eof);
vector<int>vec_1,vec_2;
for (auto e : vec) {
if (e % 2 != 0) {
vec_1.push_back(e);
}if (e % 2 == 0) {
vec_2.push_back(e);
}
}ostream_iterator<int>out_1(x, " ");
for (auto x : vec_1)out_1=x;
ostream_iterator<int>out_2(y, " ");
for (auto x : vec_2)out_2 = x;
}