#include #include using namespace std; main(int argc, char **argv) { ifstream in_fp; ofstream out_fp; string s; if (argc != 3) { cout << "Usage: wordprint inputfile outputfile\n"; exit(1); } in_fp.open(argv[1]); if (in_fp.fail()) { cout << "Couldn't open " << argv[1] << endl; exit(1); } out_fp.open(argv[2]); if (out_fp.fail()) { cout << "Couldn't open " << argv[2] << endl; exit(1); } while (!in_fp.fail()) { in_fp >> s; if (!in_fp.fail()) out_fp << s << endl; } }