daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Jan 12th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. int n,i,nr;
  5. char c[256];
  6. int main()
  7. {
  8.     cin.getline(c,256);
  9.     n=strlen(c);
  10.     for (i=1;i<n-1;i++)
  11.     {
  12.         ///daca c este vocala
  13.         if (strchr("aieou",c[i]))
  14.         {
  15.             ///verificam daca elementele de langa c[i] nu sunt vocale
  16.             if (!strchr("aieou",c[i-1]) && !strchr("aieou",c[i+1]))
  17.             {
  18.                 ///verificam daca sunt litere
  19.                 if (strchr("qwertyuiopasdfghjklzxcvbnm",c[i-1]) && strchr("qwertyuiopasdfghjklzxcvbnm",c[i+1]))
  20.                 {
  21.                     nr++;
  22.                 }
  23.             }
  24.         }
  25.     }
  26.     cout<<nr;
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top