Advertisement
nicuvlad76

Untitled

Nov 17th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. char s[301], *p;///pointer la caractere=adresa la care se gaseste sirul s
  5.  
  6. int main()
  7. {
  8. ///strchr(sirul, caracter);
  9. ///test vocala
  10.  
  11. cin.getline(s,300);
  12. int nrv=0;
  13. for(int i=0; s[i]; i++)
  14. if(strchr("aeiouAEIOU",s[i])!=NULL)///test vocala
  15. nrv++;
  16. cout<<nrv;
  17. ///test consoana mici si mari
  18. int nrc=0;
  19. for(int i=0;s[i];i++)
  20. if( (s[i]>='a'&& s[i]<='z'|| s[i]>='A'&& s[i]<='Z' )&& strchr("aeiouAEIOU",s[i])==NULL)
  21. nrc++;
  22. cout<<'\n'<<nrc;
  23.  
  24. return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement