結果 : define an algorithm with suitable example