fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. char ch[105];int lwr=0,upr=0,total=0;
  7. for(int i=0;i!='\0';i++)
  8. {
  9. if(ch[i]>=65 && ch[i]<=90)
  10. upr++;
  11. else if(ch[i]>=97 && ch[i]<=122)
  12. lwr++;
  13. }
  14.  
  15. if(upr>lwr)
  16. {
  17. for(int i=0;i!='\0';i++)
  18. {
  19. if(ch[i]>=97 && ch[i]<=122)
  20. {
  21. total++;
  22. }
  23. }
  24. cout<<total;
  25. }
  26.  
  27. else if(lwr>=upr)
  28. {
  29. for(int i=0;i!='\0';i++)
  30. {
  31. if(ch[i]>=65 && ch[i]<=90)
  32. {
  33. total++;
  34. }
  35. }
  36. cout<<total-1;
  37. }
  38. return 0;
  39. }
Success #stdin #stdout 0s 3296KB
stdin
PruvetSTAaYA
stdout
-1