因为没有马蹄钉,一个王国就消失了,或者俗话说.
给出一个输入列表,生成相关的谚语.例如,
- 给定列表
["nail", "shoe", "horse", "rider", "message", "battle", "kingdom"]
- 你将输出这个谚语的全文:
For want of a nail the shoe was lost.
For want of a shoe the horse was lost.
For want of a horse the rider was lost.
For want of a rider the message was lost.
For want of a message the battle was lost.
For want of a battle the kingdom was lost.
And all for the want of a nail.
请注意,输入列表可能会有所不同; 您的解决方案应该能够处理任意长度和内容的列表。输出文本的行不应该是静态的、不变的字符串; 所有的都应该根据给定的输入而变化.