Cod sursa(job #2272)
Utilizator | Data | 16 decembrie 2006 18:37:17 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
type tip=1..1000000;
var n,i,j:tip;
f:text;
nr:longint;
procedure citire;
begin
assign(f,'fractii.in');reset(f);
readln(f,n);
close(f);
end;
begin
citire;
nr:=n;
for i:=2 to n do
for j:=1 to n do
if j=1 then nr:=nr+1
else if i mod j<>0 then nr:=nr+1;
assign(f,'fractii.out');rewrite(f);
writeln(f,nr-1);
close(f);
end.