Advertisement
Guest User

Untitled

a guest
Jan 12th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement