Advertisement
edutedu

vr 64 pr 5

Sep 25th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. /*char a[201], vocale[15]="AEIOUaeiou";
  8. int gasit1, gasit2, ct=0, i=0;
  9. cin.get(a, 201);
  10. while(a[i])
  11. {
  12. if(strchr(vocale,a[i]))
  13. gasit1=1;
  14. else
  15. gasit1=0;
  16. while(a[i]!=' ' && a[i]!=0)
  17. i++;
  18. if(strchr(vocale, a[i-1]))
  19. gasit2=1;
  20. else
  21. gasit2=0;
  22. if(gasit1*gasit2==1)
  23. ct++;
  24. i++;
  25. }
  26. if(ct==0)
  27. cout<<"Nu exista";
  28. else
  29. cout<<ct;*/
  30. char a[256], v[11]="aeiouAEIOU", *p;
  31. int ct=0, n;
  32. p=strtok(a, " ");
  33. while(p)
  34. {
  35. n=strlen(p);
  36. if(strchr(v,p[0]) && strchr(v, p[n-1]))
  37. ct++;
  38. p=strtok(NULL, " ");
  39. }
  40. cout<<ct;
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement