#include #include #include void main() { ifstream infile("intext.txt"); ofstream outfile("outtext.txt"); char x; int spaces = 0; bool found = false; while(infile.get(x)) { if (x != ' ' && !found) { spaces++; } else if(x == '\n') { outfile << "\n"; cout << "\n"; spaces = 0; found = false; } else { if(!found) { found = true; outfile << setw(2) << spaces << " "; cout << setw(2) << spaces<< " "; } cout << x; outfile << x; } } cout << "\n\n"; }