fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <vector>
  4.  
  5. int main()
  6. {
  7. std::string str = "The quick br1own f@ox jumps over t-he lazy dog.";
  8. std::istringstream iss(str, std::istringstream::in);
  9. std::vector<std::string> words;
  10. while( iss >> str ) words.push_back(str);
  11. for(auto&x:words)
  12. {
  13. for(size_t i=0; i<x.size(); i++)
  14. {
  15. if(!std::isdigit(x[i]) && !std::isalpha(x[i]))
  16. {
  17. std::cout << x <<std::endl;
  18. break;
  19. }
  20. }
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
f@ox
t-he
dog.