Gym - 101190A Abbreviation(아날로그)
4675 단어 CodeForces
ACM ICPC 2016–2017, Northeastern European Regional Contest.St. Petersburg – Barnaul – Tbilisi – Almaty, December 4, 2016Problem A. AbbreviationInput file: abbreviation.inOutput file: abbreviation.outAn abbreviation (from Latin brevis, meaning short) is a shortened form of a word or phrase. In thisproblem you must write an automated tool that replaces a sequence of capitalized words with the corresponding abbreviation that consists of the first upper case letters only, followed by a full definition inparenthesis. See sample input and output.Let us make some formal definitions. A word in a text is a maximally long sequence of lower and uppercase English letters. A capitalized word is a word that consists of an upper case letter followed by oneor more lower case letters. For example, “Ab”, “Abc”, “Abcd”, and “Abcde“are all capitalized words,while “ab”, “A”, “AB“, “ABc“and “AbC“are not.An abbreviatable sequence of words is a sequence of two or more capitalized words that are separated byexactly one space, no line breaks or punctuation are allowed inside it.An abbreviation of an abbreviatable sequence of words is a sequence of the first (upper case) letters ofeach word, followed by a single space, an opening parenthesis, the original abbreviatable sequence, anda closing parenthesis.InputThe input file consists of up to 1 000 lines of text with up to 120 characters on each line. Each lineconsists of spaces, upper and lower case letters, commas or dots. There are no leading or trailing spaceson lines and there are no empty lines. There is at least one line in the input file.OutputWrite to the output file the original text with every abbreviatable sequence of words replaced with thecorresponding abbreviation.Examplesabbreviation.inThis is ACM North Eastern European Regional Contest,sponsored by International Business Machines.The. Best. Contest. Ever.A Great Opportunity for all contestants.abbreviation.outThis is ACM NEERC (North Eastern European Regional Contest) ,sponsored by IBM (International Business Machines).The. Best. Contest. Ever.A GO (Great Opportunity) for all contestants.abbreviation.inab Ab A Abc AB Abcd ABc Abcde AbCabbreviation.outab Ab A Abc AB Abcd ABc Abcde AbCabbreviation.inOh No Extra Spaces.And,Punctuation Ruin Everythingabbreviation.outOh No ES (Extra Spaces).And, PRE(Punctuation Ruin Everything):
요구에 따라 일부분을 줄임말로 바꾸는 일련의 문자를 주다
제목에 따라 시뮬레이션을 하면 돼요.
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
문제 풀이 보고서 의 CodeForces 91B QueueOtherwise, print the i-th walrus's displeasure: the number of other walruses that stand between him and the furthest fro...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.