#C1027. Longest Word Finder
Longest Word Finder
Longest Word Finder
Your task is to implement a program that finds and returns the longest word in a given string. If there are multiple words with the same maximum length, the program should return the one that appears first in the string.
Note: Let \( s \) be the input string, and let \( words \) be the list of words obtained by splitting \( s \) by whitespace. You need to find the word \( w^* \) such that for any word \( w \) in \( words \), \(|w^*| \geq |w|\), choosing the first occurrence if there is a tie.
inputFormat
The input consists of a single line containing a string \( s \) with one or more words separated by whitespace. The string length will not exceed typical limits.
outputFormat
Output a single line containing the longest word found in the string. If there is a tie, output the word that appears first.
## sampleThe quick brown fox
quick