daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest May 16th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool isCorrect(char c) {
  2.     return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('а' <= c && c <= 'я') || ('А' <= c && c <= 'Я');
  3. }
  4.  
  5. string currentWord = "";
  6. char c;
  7. vector<string> words;
  8. while (!in.eof()) {
  9.     in >> c;
  10.     if (!isCorrect(c)) {
  11.         if (currentWord.size() > 0) {
  12.             words.push_back(currentWord);
  13.         }
  14.         currentWord = "";
  15.     } else {
  16.         currentWord += c;
  17.     }
  18. }
  19. if (currentWord.size() > 0) {
  20.     words.push_back(currentWord);
  21. }
RAW Paste Data
Top