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