Pomoże ktoś z tym algorytmem?

Odpowiedź:
LICZĘ NA NAJ ! ;)