Cod sursa(job #584618)

Utilizator vladvaldezVlad Dimulescu vladvaldez Data 26 aprilie 2011 10:17:12
Problema Fractii Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.32 kb
var n,i,j,fr:longint;
begin
assign(input,'fractii.in');reset(input);
assign(output,'fractii.out');rewrite(output);
read(n);
fr:=n;
for i:=2 to n do
 for j:=1 to n do begin
 if j=1 then inc(fr)
 else begin
 if  i>j then if i mod j<>0 then inc(fr);
 if j>i then if j mod i<>0 then inc(fr);
 end;
 end;
write(fr);
end.