一般而言一个单词由字母a − z、A − Z 组成,但可能包含一个或多个连字符(-)。给定一个包含单词和其他字符(标点符号、数字、符号等) 的文本,请编写一个程序来查找该文本中最长的单词。
比如:
单词ROBOYoung 的长度是9
单词ROBO-Young的长度是10
单词RO-BO-Young的长度是11
一个长度不超过10000 的文本,文本中单词的长度不超过100,文本以E-N-D结束。
以小写字母形式打印出最长的单词。如果存在多个最长的单词,则打印第一个最长单词。
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
international