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. cin>>ch;
  8. for(int i=0;i!='\0';i++)
  9. {
  10. if(ch[i]>=65 && ch[i]<=90)
  11. upr++;
  12. else if(ch[i]>=97 && ch[i]<=122)
  13. lwr++;
  14. }
  15. cout<<lwr<<" "<<upr<<endl;
  16.  
  17. if(upr>lwr)
  18. {
  19. for(int i=0;i!='\0';i++)
  20. {
  21. if(ch[i]>=97 && ch[i]<=122)
  22. {
  23. total++;
  24. }
  25. }
  26. cout<<total;
  27. }
  28.  
  29. else if(lwr>=upr)
  30. {
  31. for(int i=0;i!='\0';i++)
  32. {
  33. if(ch[i]>=65 && ch[i]<=90)
  34. {
  35. total++;
  36. }
  37. }
  38. cout<<total-1;
  39. }
  40. return 0;
  41. }
Success #stdin #stdout 0s 3344KB
stdin
PruvetSTAaYA
stdout
0 0
-1