vlatkovski

Zbor

Jun 7th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. bool e_samoglaska(char c) {
  7.     return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
  8. }
  9.  
  10. int main() {
  11.     string s;
  12.     cin >> s;
  13.  
  14.     int t = 0;
  15.  
  16.     for (int i = 0; i < s.length() - 1; ++i) {
  17.         char curr = s.at(i);
  18.         char next = s.at(i + 1);
  19.  
  20.         if (!e_samoglaska(curr) && !e_samoglaska(next)) {
  21.             t++;
  22.         }
  23.     }
  24.  
  25.     cout << t;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment