Pagini recente » Cod sursa (job #636311) | Cod sursa (job #318183) | Cod sursa (job #2311481) | Cod sursa (job #345950) | Cod sursa (job #920339)
Cod sursa(job #920339)
var f,g : text;
n,i,j,total : longint;
function verifica(x,y : longint) : boolean;
{var aux,r : longint;}
begin
while x <> y do
if x > y then x := x-y
else y := y-x;
if y = 1 then verifica := true
else verifica := false;
end;
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
if verifica(i,j) then total := total+1;
write(g,total);
close(f); close(g);
end.