#C9764. Longest Word Finder
Longest Word Finder
Longest Word Finder
Given a sentence containing several words, your task is to find the longest word. If there are multiple words with the same maximum length, return the one that appears first.
For example, given the input string "The quick brown fox", the longest word is "quick". If the input string is empty, output an empty string.
Note: The solution should process the input from standard input (stdin) and output the result to standard output (stdout).
inputFormat
The input consists of a single line which contains a sentence. The sentence may include multiple words separated by spaces. The sentence can also be empty.
outputFormat
Output the longest word found in the input sentence. If multiple words share the same maximum length, output the first one. If the input is empty, output an empty string.## sample
hello
hello