Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* in the name of Allah */
- #include <algorithm>
- #include <bitset>
- #include <cassert>
- #include <cctype>
- #include <climits>
- #include <cmath>
- #include <complex>
- #include <cstdio>
- #include <cstdlib>
- #include <cstring>
- #include <ctime>
- #include <deque>
- #include <fstream>
- #include <functional>
- #include <iomanip>
- #include <iostream>
- #include <limits>
- #include <list>
- #include <map>
- #include <numeric>
- #include <queue>
- #include <set>
- #include <sstream>
- #include <stack>
- #include <string>
- #include <utility>
- #include <vector>
- using namespace std;
- template< class T > void print(vector <T> ans){ for(unsigned int i = 0 ; i < ans.size() ; i++ ) cout << ans[i] << " " ; cout << endl ; }
- template< class T > void print2(T ans){ cout << ans ; cout << endl ; }
- template< class T > string tos(T x) {stringstream s ; s << x; return s.str();}
- template< class T > long long toi(T x) {istringstream is(x) ; long long num ; is >> num ; return num ;}
- template< class T > bool prime(T n){ if(n == 1 || n == 0) return false ; if(n == 2 || n == 3 || n == 5 || n == 7) return true ; for(int i = 2 ; i*i <= n ; i++){ if(n % i == 0) return false ; } return true ; }
- template< class T > long long sum_arr(T x) { long long sum = 0 ; for(int i = 0 ; i < x.size() ; i++) sum += x[i] ; return sum ;}
- template< class T > vector <T> find_divisor(T num){ vector <T> res ; res.clear() ; for(int i = 1 ; i <= num/2 ; i++) if(num % i == 0) res.push_back(i) ; return res ; }
- template< class T > vector <T> clear_rep(vector <T> v){ T temp ; vector <T> res ; res.clear() ; for(int i = 0 ; i < v.size() ; i++){temp = v[i] ; if(found(res,temp) == false) res.push_back(temp); } return res ;}
- template< class T > vector <T> parse(T temp){ vector <T> ans ; ans.clear() ; T s ; istringstream is(temp) ; while(is >> s){ /*cout << s << endl ;*/ ans.push_back(s) ; } return ans ; }
- template< class T , class M > bool found(T x , M element) { for(int i = 0 ; i < x.size() ; i++) if(x[i] == element) return true ; return false ;}
- template< class T , class M > inline T sqr(T x , M y){/* compute to 2^63*/ T temp = 1 ; if(y == 0) return 1 ; for(int i = 1 ; i <= y ; i++) temp *= x ; return temp ;}
- #define PB push_back
- #define ALL(a) a.begin(),a.end()
- #define SZ(v) ((int)(v).size())
- #define FOR(i,start,end) for(int i = start ; i < end ; i++)
- #define REP(i,start,end) for(int i = start ; i >= end ; i--)
- bool isUpperCase(char c){return c>='A' && c<='Z';}
- bool isLowerCase(char c){return c>='a' && c<='z';}
- char toLowerCase(char c){return (isUpperCase(c))?(c+32):c;}
- char toUpperCase(char c){return (isLowerCase(c))?(c-32):c;}
- int main()//55 - A. Word
- {
- //ifstream cin("input.in") ;
- string str , ans ;
- int Upper = 0 , Lower = 0 ;
- cin >> str ;
- FOR(i,0,SZ(str))
- {
- if(isUpperCase(str[i]))
- Upper ++ ;
- else
- Lower ++ ;
- }
- if(Upper == Lower || Upper < Lower)
- FOR(i,0,SZ(str))
- ans += (toLowerCase(str[i])) ;
- else
- FOR(i,0,SZ(str))
- ans += (toUpperCase(str[i])) ;
- cout << ans ;
- return 0 ;
- }
- /*
- ---------------------------------------------
- Input:
- ---------
- HoUse
- ViP
- maTRIx
- ---------------------------------------------
- Output:
- ---------
- house
- VIP
- matrix
- ---------------------------------------------
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement