Pagini recente » Cod sursa (job #1879520) | Cod sursa (job #1589656) | Cod sursa (job #994635) | Cod sursa (job #2375170) | Cod sursa (job #2337966)
function al (a,b : longint) : longint;
var z : longint;
begin
while a <>0 do
begin
if a <b then
begin
z := a;
a := b;
b := z;
end;
a := a mod b;
end;
al := b;
end;
var i,n,j,c,z : longint;
begin
assign(f, 'fractii.in' );
assign(g, 'fractii.out');
reset(f);
rewrite(g)
read(f,n);
for i := 1 to n do
begin
for j := 1 to n do
begin
if al(i,j) = 1 then
z := z+1;
end;
end;
write(g,z);
close(g);
end.