fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios_base::sync_with_stdio(false);
  7. cin.tie(0);
  8.  
  9. string s;
  10. cin >> s;
  11.  
  12. int len = s.length(), upper = 0, lower = 0;
  13.  
  14. for (int i = 0; i < len; i++)
  15. {
  16. if (isupper(s[i]))
  17. upper++;
  18. else if (islower(s[i]))
  19. lower++;
  20. }
  21.  
  22. if (upper > lower)
  23. for (int i = 0; i < len; i++)
  24. cout << (char)toupper(s[i]);
  25. else
  26. for (int i = 0; i < len; i++)
  27. cout << (char)tolower(s[i]);
  28. }
Success #stdin #stdout 0.01s 5280KB
stdin
ViP
stdout
VIP