input.txt
54 1 42 3 0 34 13 8 9 0 43
output.txt
54 1 1 42 3 0 0 34 13 8 9 0 0 43
#include <iostream>
#include <fstream>
int main ()
{
int tmp;
std::ifstream FILE_in ("input.txt", std::ios::in);
std::ofstream FILE_out ("output.txt", std::ios::out);
if ((!FILE_in) || (!FILE_out)) {
std::cerr << "ERROR!" << std::endl;
system ("pause");
return 1; }
while (!FILE_in.eof())
{
FILE_in >> tmp;
FILE_out << tmp << " ";
if ((tmp==0) || (tmp==1))
FILE_out << tmp << " ";
}
FILE_in.close();
FILE_out.close();
system ("pause");
return 0;
}