Pagini recente » Cod sursa (job #650190) | Cod sursa (job #2896912) | Cod sursa (job #2903033) | Cod sursa (job #2295524) | Cod sursa (job #170922)
Cod sursa(job #170922)
var
f:text;
n,p,q,k:longint;
function ire(x,y:longint):longint;
begin
if x mod y=0 then ire:=y
else
ire:=ire(y,x mod y);
end;
begin
assign(f,'fractii.in');
reset(f);
readln(f,n);
close(f);
{randomize;
n:=random(9999)+1 ;}
assign(f,'fractii.out');
rewrite(f);
for p:=1 to n do
for q:=1 to n do
begin
if ire(p,q)=1 then inc(K);
end;
write(f,k);
close(f);
end.