/* * @topic T00325 Apr 18 -- how to skip digits v.1 * @brief Program demonstrates <tt><cctype></tt> header and <tt>isdigit()</tt> function */ #include <iostream> #include <cctype> using namespace std; int main() { // This version of the program reads characters // from the standard input device. int onechar; // using int because char cannot represent EOF while ( ( onechar = std::cin.get() ) != EOF ) { if ( isdigit( onechar ) ) { continue; // skip digit } std::cout.put( onechar ); // print a non-digit character } return 0; }