#t195. 最长最短单词
最长最短单词
Longest and Shortest Word
Problem Description
Input one line of a sentence (at most words, each word at most characters long), containing only letters, spaces, and commas. A word consists of one or more consecutive letters, and words are separated by spaces or commas.
Output the first longest word and the first shortest word.
Input Format
One line containing a sentence.
Output Format
Two lines of output:
- The first line: the first longest word.
- The second line: the first shortest word.
Sample Input
I am studying Programming language C in Peking University
Sample Output
Programming
I