Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. char s[100000];
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int i,cons=0,vocale=0,contr=0,co=1,ok=0;
  9. cin>>s;
  10. for(i=0;i<strlen(s);i++)
  11. {
  12. if(strchr("bcdfhjklmnpqrstvwxzy",s[i]) || strchr("BCDFHJKLMNPQRSTVWXY",s[i]))
  13. cons++;
  14. if(strchr("AEIOU",s[i]) || strchr("aeiou",s[i]))
  15. vocale++;
  16. if(strchr("+",s[i]))
  17. cons++;
  18. if(strchr("-",s[i]))
  19. vocale++;
  20. if(strchr("*",s[i]))
  21. ok++;
  22. if(i%5==0)
  23. {
  24. i=i-4;
  25. if(ok==1)
  26. {if(vocale+cons+ok==5)
  27. contr++;
  28. else if(vocale+cons==5)
  29. contr++;
  30. vocale=0;
  31. cons=0;
  32. ok=0;
  33. }}}
  34. cout<<contr;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement