Pagini recente » Cod sursa (job #394381) | Cod sursa (job #894520) | Cod sursa (job #535385) | Cod sursa (job #1194250) | Cod sursa (job #846304)
Cod sursa(job #846304)
var i,j:longint;
n:longint;
nr:longint;
f,g:text;
function ireductibila(x,y:longint):boolean;
var i:longint;
min:integer;
begin
min:=x;
if min>y then min:=y;
ireductibila:=true;
for i:=2 to min do
if (x mod i=0) and (y mod i=0) then begin
ireductibila:=false;
break;
end;
end;
begin
assign(f,'fractii.in');
assign(g,'fractii.out');
reset(f);
rewrite(g);
read(f, n);
nr:=0;
for i:=1 to n do
for j:=1 to n do
if ireductibila(i,j) then
inc(nr);
write(g,nr);
close(g);
end.