a53

Caracterul mediu 1

a53
Jan 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int nrc, s;
  6. char ch, voc[]="aeiouAEIOU";
  7. int main()
  8. {
  9. while(cin>>ch)
  10. {
  11. if(isalpha(ch))
  12. {
  13. if(!isupper(ch) && !strchr(voc,ch))
  14. {
  15.  
  16. nrc++;
  17. s+=(int)ch;
  18. }
  19. }
  20. else if(!isspace(ch))
  21. {
  22. nrc++;
  23. s+=(int)ch;
  24. }
  25. }
  26. cout<<(char)(s/nrc);
  27. return 0;
  28. }
Add Comment
Please, Sign In to add comment