A ?sh-?nder is a device used by anglers to ?nd ?sh in a lake. If the ?sh-?nder ?nds a ?sh, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the ?sh-?nder will decide that a ?sh is swimming past if:
fish-finder是一个神奇的装置供垂钓者使用区在护理钓鱼。如果一个f-f找到了一条鱼,他会响起声音警报。它用鱼的深度来决定是否响警报。我们的目的就是要决定鱼是否通过,具体如下:
• there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call “Fish Rising”), or
如果连续的四个深度读入是严格递增的序列,我们可以叫它 Fish Rising 。
• there are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call “Fish Diving”), or
如果连续的四个深度读入是严格递减的序列,我们可以叫它 Fish Diving 。
• there are four consecutive depth readings which are identical (which we will call “Constant Depth”).
All other readings will be considered random noise or debris, which we will call “No Fish.”
Your task is to read a sequence of depth readings and determine if the alarm will sound.
如果连续的四个深度读入是一样的,那就是“Fish At Constant Depth”。如果都不是,就是“No Fish”。