fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <cctype>
  5.  
  6. int main()
  7. {
  8. std::string pass = "AbAbbb1cc2";
  9.  
  10. int upps = std::count_if( pass.begin(), pass.end(), isupper );
  11. int digs = std::count_if( pass.begin(), pass.end(), isdigit );
  12.  
  13.  
  14. std::cout << "uppercase=" << upps << " digits=" << digs << std::endl;
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
uppercase=2 digits=2