Write a program that provided a sequence of words prints the longest
word in the sequence that starts with a.
The input has one or more cases. Each case starts with a non negative integer followed by a sequence of words consisting of lowercase letters.
For each case, the program has to print in a line the longest word
starting with a. In case of a tie, it will
write the lowest in the alphabetical order —the order defined by the
standard inequality comparison on strings—. If there is no word starting
with ’a’, the program has to write no one.
Author: ProAl
Generation: 2026-01-25T13:38:05.706Z
© Jutge.org, 2006–2026.
https://jutge.org