fork download
  1. #include <algorithm>
  2. #include <cctype>
  3. #include <iostream>
  4.  
  5. int main()
  6. {
  7. std::string s = "Contains punctuation!!";
  8. std::string s2 = "No puncuation";
  9. std::cout << std::any_of(s.begin(), s.end(), ::ispunct) << '\n';
  10. std::cout << std::any_of(s2.begin(), s2.end(), ::ispunct) << '\n';
  11. }
  12.  
Success #stdin #stdout 0s 4324KB
stdin
Standard input is empty
stdout
1
0