Largest prime factor

Implement an efficient function

        int largest_prime_factor(int n);

that returns the largest prime factor of @n@.

Precondition

It holds @n@  ≥ 2.

Observation

You only need to submit the required procedure; your main program will
be ignored.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:12:48.906Z

© Jutge.org, 2006–2026.
https://jutge.org
