/* Counts only the numeric characters '0' - '9' read from standard input */ #include int main( void ) { int n = 0; char c; while ( ( std::cin >> c ) ) { if ( c >= '0' && c <= '9' ) n = n + 1; } std::cout << "Count of digits = " << n << '\n'; }