fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cctype>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string s = "12345678";
  10. cout << boolalpha << all_of(s.begin(), s.end(), ::isdigit) << endl;
  11. s[0] = 'x';
  12. cout << boolalpha << all_of(s.begin(), s.end(), ::isdigit) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
true
false