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