Pagini recente » Cod sursa (job #667939) | Cod sursa (job #1065118) | Cod sursa (job #372934) | Cod sursa (job #1098475) | Cod sursa (job #1712878)
var i,j,c,n:longint;
f,t:text;
Function diviz(a,b:integer):boolean;
var i:integer;
begin
diviz:=true;
if a>b then
for i:=2 to a do
if (a mod i = 0) and (b mod i = 0) then begin diviz:=false; exit; end;
if b>a then
for i:=2 to b do
if (a mod i = 0) and (b mod i = 0) then begin diviz:=false; exit; end;
end;
begin
assign(f,'fractii.in');
reset(f);
read(f,n);
c:=1;
for i:=1 to n do
for j:=1 to n do
if (i<>j) and (diviz(i,j)=true) then writeln(i,'/',j) {inc(c)};
assign(t,'fractii.out');
rewrite(t);
write(t,c);
close(t);
end.