21202_TheBraveSirRobin’scAsEcOrReCtOr

2022-5-16 18:18| 发布者: Hocassian| 查看: 37| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-8950512482800-Problem List-采集的数据-后羿采集器.html

Pro.ID

21202

Title

The Brave Sir Robin’s cAsE cOrReCtOr

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21202

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1500/500 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Dissatisfied with the loud and constant pronouncements of his alleged misdeeds by a trio of indefatigable minstrels, the brave knight Sir Robin wishes to exercise his authority by modifying their lyrics. The minstrels were happy to provide printed transcripts of their songs, and cheerfully announced that they would not change a word of them.
    Undaunted, the brave (and crafty) Sir Robin scrutinized the documents and noticed that their loudest inflections were indicated by capital letters and realized that he could at least lower their voices. This, he reasoned, could be accomplished by replacing upper case letters with lower case letters (“Case correction”, from his perspective). These modifications could be forced upon the singers by insistence upon proper usage of the King’s English. Not all letters can be lower case, however, as the King’s English mandates some letters must be upper case.
    Strangely hesitant about performing “case correction” personally, the brave, crafty (and managerially capable) Sir Robin humbly requests you write a program to perform a first pass of case correction for the songs. There will still be some corrections required after this program is used.
    As your program reads the file, it must force to upper case all alphabetic characters that follow terminal punctuation marks (period, question mark, and exclamation point) with only white space or parentheses characters following. All other alphabetic characters are to be forced to lower case. Note that decimal numbers are not to be followed by an upper case character unless the number itself is followed by a terminal punctuation mark.

    输入

    The input file contains the text that you are converting. Your conversions should be based on the rules given by Brave Sir Robin above.

    输出

    Description
    Dissatisfied with the loud and constant pronouncements of his alleged misdeeds by a trio of indefatigable minstrels, the brave knight Sir Robin wishes to exercise his authority by modifying their lyrics. The minstrels were happy to provide printed transcripts of their songs, and cheerfully announced that they would not change a word of them.
    Undaunted, the brave (and crafty) Sir Robin scrutinized the documents and noticed that their loudest inflections were indicated by capital letters and realized that he could at least lower their voices. This, he reasoned, could be accomplished by replacing upper case letters with lower case letters (“Case correction”, from his perspective). These modifications could be forced upon the singers by insistence upon proper usage of the King’s English. Not all letters can be lower case, however, as the King’s English mandates some letters must be upper case.
    Strangely hesitant about performing “case correction” personally, the brave, crafty (and managerially capable) Sir Robin humbly requests you write a program to perform a first pass of case correction for the songs. There will still be some corrections required after this program is used.
    As your program reads the file, it must force to upper case all alphabetic characters that follow terminal punctuation marks (period, question mark, and exclamation point) with only white space or parentheses characters following. All other alphabetic characters are to be forced to lower case. Note that decimal numbers are not to be followed by an upper case character unless the number itself is followed by a terminal punctuation mark.
    Input
    The input file contains the text that you are converting. Your conversions should be based on the rules given by Brave Sir Robin above.
    Output
    The output is to be the converted text. All characters are transferred to the output. Some will have cAsE cOrReCtiOn, others will be directly copied.
    Sample Input
    The Brave Sir Robin took a short walk in a dark forest where rabbits did stalk. a ray of sunlight made him jump from his own shadow with A FACE AS PALE AS CHALK.
    Sample Output
    the brave sir robin took a short walk in a dark forest where rabbits did stalk. A ray of sunlight made him jump from his own shadow with a face as pale as chalk.
    Source

    样例输入

    The Brave Sir Robin took a short walk in a dark forest where rabbits did stalk. a ray of sunlight made him jump from his own shadow with A FACE AS PALE AS CHALK.

    样例输出

    the brave sir robin took a short walk in a dark forest where rabbits did stalk. A ray of sunlight made him jump from his own shadow with a face as pale as chalk.

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部