Məsələlər
Longest Word
Longest Word
A word is composed of only letters of the alphabet (\textbf{a}-\textbf{z}, \textbf{A}-\textbf{Z}) and may contain one hyphen (\textbf{-}) or more. Given a text containing words, and other characters (punctuations, numbers, symbols, etc), you are to write a program to find the longest word.
Each letter or a hyphen in a word is counted as \textbf{1}. For example,
The length of \textbf{Apple} is \textbf{5}
The length of \textbf{son-in-law} is \textbf{10}
The length of \textbf{ACM-ICPC} is \textbf{8}
\InputFile
A text may contain several lines and paragraphs but the text does not exceed \textbf{10000} characters. No word can exceed \textbf{100} characters. The word \textbf{E-N-D} indicates the end of input.
\OutputFile
Print out the longest word in small letters. If there exist several longest words, print only the first one found in the text.
Giriş verilənləri #1
ACM International Collegiate Programming Contest (abbreviated as ACM-ICPC or just ICPC) is an annual multi-tiered computer programming competition among the universities of the world. The contest is sponsored by IBM. Headquartered at Baylor University, with autonomous regions on six continents, the ICPC is directed by Baylor Professor William B. Poucher, Executive Director, and operates under the auspices of the Association for Computing Machinery (ACM). The 2012 ACM-ICPC Asia Hatyai Regional Programming Contest is held during 15-16 November 2012. It is hosted by Prince of Songkla University, Hatyai campus. E-N-D
Çıxış verilənləri #1
international