#include #include #include using namespace std; int main(int argc, char* argv[]) { if ( argc != 2 ) { cerr << "ERROR: File argument missing." << endl; return 1; } ofstream ofs(argv[1]); if ( ! ofs ) { cerr << "ERROR: File could not be opened." << endl; return 1; } random_device r; uniform_int_distribution d(' ', '~'); // 32 - 126 char c; while ( cin.get(c) ) { ofs << c; c = d(r); ofs << c; for (int i = 0; i < c; ++i) ofs << d(r); } ofs.close(); return 0; }