#P7933. [COCI 2007/2008 #5] PASCAL
[COCI 2007/2008 #5] PASCAL
Problem Description
Little Frane is already in the 10th grade, but he still finds learning Pascal in computer class very difficult. The teacher wrote the following Pascal program as homework. Given the input integer , he needs to determine the program’s output.
readln(N);
counter := 0;
for i := N-1 downto 1 do begin
counter := counter + 1;
if N mod i = 0 then break;
end;
writeln(counter);
Please write a program to solve this problem.
Input Format
One line, an integer .
Output Format
One line, the output produced by the program above.
1
0
10
5
27
18
Hint
For of the testdata, .
The score of this problem follows the original contest settings, with a full score of points.
Translated by ChatGPT 5