Cod sursa(job #1011426)
Utilizator | Data | 16 octombrie 2013 20:37:59 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
program fract;
var i,j,n,s:longint;
f:text;
begin
assign(f,'fractii.in'); reset(f);
readln(f,n);
close(f);
s:=n;
for i:=2 to n do
for j:=1 to n do begin
if j=1 then s:=s+1;
if (i>j) and (i mod j<>0) then s:=s+1;
if (i<j) and (j mod i<>0) then s:=s+1;
end;
assign(f,'fractii.out'); rewrite(f);
write(f,s);
close(f);
end.