Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. //Text max 200
  7. //Sa se afiseze pe cate un rand al ecranului cuvintele care incep cu o consoana
  8. //si au dimensiune para
  9.  
  10. int main()
  11. {
  12. char s[201];
  13. int i, j, k;
  14. cin.get(s, 201);
  15. i=j=0;
  16. while(j<strlen(s))
  17. {
  18. while(s[j]!=' ' && s[j]!='\0')
  19. j++;
  20. if((j-i)%2==0 && strchr("aeiou", s[i])==0)
  21. {
  22. for(k=i; k<j; k++)
  23. cout<<s[k];
  24. cout<<endl;
  25. }
  26. i=j=j+1;
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement