Advertisement
erfanul007

non vowel words

Nov 5th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int test;
  8. scanf("%d",&test);
  9. getchar();
  10. for(int t=1;t<=test;t++){
  11. char s[1000];
  12. gets(s);
  13. int ln = strlen(s);
  14. int temp = 0;
  15. int cnt=0;
  16. for(int i=0;i<ln;i++){
  17. if(s[i]==' '){
  18. if(temp==0){
  19. cnt++;
  20. }
  21. temp=0;
  22. }
  23. else{
  24. if(s[i]=='a' || s[i]=='A' || s[i]=='e' || s[i]=='E' || s[i]=='i' || s[i]=='I' || s[i]=='o' || s[i]=='O' || s[i]=='u' || s[i]=='U'){
  25. temp = 1;
  26. }
  27. }
  28. }
  29. if(temp==0) cnt++;
  30. printf("%d\n", cnt);
  31. }
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement