The mixed letters

2020年1月17日 1619点热度 0人点赞 0条评论

The mixed letters

时间: 1ms        内存:128M

描述:

Mike is very upset that many people on the Internet usually mix uppercase and lowercase letters in one word. That's why he decided to invent an extension for his favorite browser that would change the letters' case in every word so that it either only consisted of lowercase letters or only consisted of uppercase ones. And he wants to change as few letters as possible in the word.
For example, the word "HoUse" must be changed to "house", and the word "ViP", to "VIP".
If a word contains an equal number of uppercase and lowercase letters, you should replace all the letters with lowercase ones. For example, "maTRIx" should be changed to "matrix".
You task is to use the given method to change the given word.

输入:

The first line contains a single integer n (n<=30), indicating the number of test cases.
Then following n lines, each line contains a word s, it consists of uppercase and lowercase
Latin letters and its length is between 1 and 100, inclusive.

输出:

Print the word s after change. If the given word s has strictly more uppercase letters, make the word written in the uppercase register, otherwise, in the lowercase one.

示例输入:

3
HoUse
ViP
maTRIx

示例输出:

house
VIP
matrix

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论