Pregunta de entrevista de Cargomatic

given a sorted array, print the elements whose sum is equal to n.