#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 rnd; uniform_int_distribution dist(0,6); for ( int i = 0; i < 7*7; ++i ) { int x{ dist(rnd) }; ofs << x << ' '; cout << x << ' '; } ofs.close(); return 0; }