Write a program that, given a sequence of words, prints the number of
words between the word “beginning” and the word
“end”. If the word “beginning”, the word
“end” or both words are missing, or if they appear in
inverse order, tell so.
Input consists of several words. The words “beginning”
and “end” appear, at most, once.
Print the number of words between the word “beginning”
and the word “end”, if these appear in this order.
Otherwise, print “wrong sequence”.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:01:09.935Z
© Jutge.org, 2006–2026.
https://jutge.org