CF59A.Word

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Vasya is very upset that many people on the Net 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' register in every word so that it either only consisted of lowercase letters or, vice versa, only of uppercase ones. At that as little as possible letters should be changed in the word. For example, the word HoUse must be replaced with house, and the word ViP — with 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 replaced by matrix. Your task is to use the given method on one given word.

瓦西娅非常不满网络上很多人在一个单词中混用大写和小写字母。因此,他决定为最喜爱的浏览器开发一个扩展程序,该程序将修改每个单词中字母的大小写,使得单词全部由小写字母组成,或者全部由大写字母组成。同时,应使单词中被修改的字母数量尽可能少。例如,单词 HoUse 应替换为 house,而单词 ViP 应替换为 VIP。如果一个单词中大写字母和小写字母的数量相等,则应将所有字母替换为小写字母。例如,maTRIx 应替换为 matrix。你的任务是:对给定的一个单词,应用上述方法进行转换。

输入格式

The first line contains a word s — it consists of uppercase and lowercase Latin letters and possesses the length from 1 to 100.

第一行包含一个单词 ss — 它由大写和小写的拉丁字母组成,长度为 11 到 100100。

输出格式

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

输出修正后的单词 ss。如果给定的单词 ss 中大写字母的数量严格多于小写字母的数量,则将该单词全部转换为大写形式;否则,全部转换为小写形式。

输入输出样例

  • 输入#1

    HoUse

    输出#1

    house
  • 输入#2

    ViP

    输出#2

    VIP
  • 输入#3

    maTRIx

    输出#3

    matrix

输入解题思路,AI测评打分。不知道怎么写?

首页