Pagini recente » Cod sursa (job #2572378) | Cod sursa (job #2454162) | Cod sursa (job #1955850) | Cod sursa (job #2462610) | Cod sursa (job #21702)
Cod sursa(job #21702)
var f,g:text; ok:boolean;
n,i,j,k,nr:integer;
begin
assign(f,'fractii.in'); reset(f);
assign(g,'fractii.out'); rewrite(g);
read(f,N); nr:=0;
for i:=1 to n do
for j:=1 to n do
begin
ok:=true;
if i=1 then inc(nr); if (j=1) and (i<>1) then inc(nr);
if (i<>1) and (j<>1) then
begin
for k:=2 to j do if (j mod k=0) and (i mod k=0) then ok:=false;
if ok then inc(nr);
end;
end;
write(g,nr);
close(g);
end.