Pagini recente » Cod sursa (job #620877) | Cod sursa (job #2067344) | Cod sursa (job #1071553) | Cod sursa (job #3193349) | Cod sursa (job #21538)
Cod sursa(job #21538)
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);
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.