// 8:13 // 8:24 #include #include #include #include ifstream input; void DO_DDS(char inch) { char ch; string str=""; bool leaf=true; // cout << "Top of DO_DDS "<< inch << endl; input.get(ch); while (ch != inch) { if (isdigit (ch)) { leaf = false; DO_DDS(ch); } else { str = str + ch; } input.get(ch); } if (leaf) { cout << str; } // cout << "Bottom of DO_DDS "<< ch << endl; } int main () { char ch; input.open("DDS.dat"); // keep at it until we reach the EOF. while (input) { // get a character to prime the pump input.get(ch); while ((!isdigit(ch)) && (input)) { // cout << "?"<< ch << "?"; input.get(ch); } if (!input) { // end of file, bail cout << endl; input.close(); return(0); } // here so it must be a digit. DO_DDS(ch); } cout << endl; input.close(); return(0); }