fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. int main() {
  5. char text[] = "hjn345njjj789mmm0";
  6. auto number_of_digits =
  7. std::count_if(std::begin(text), std::end(text), isdigit);
  8. std::cout << "Number of digits " << number_of_digits << '\n';
  9. }
  10.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
Number of digits 7