Pagini recente » Rating Katyia (Katyia) | Cod sursa (job #1019380) | Cod sursa (job #187522) | Cod sursa (job #808476) | Cod sursa (job #557647)
Cod sursa(job #557647)
program fractii;
var n,i,j,c,k,d:longint;
f:text;
begin
assign(f,'fractii.in');
reset(f);
readln(f,n);
close(f);
for i:=1 to n do
for j:=1 to n do
begin
if (i=1)or(j=1) then
inc(c)
else
if (i<>j)and(j mod i<>0)and(i mod j<>0) then
if i<j then
begin
d:=0;
for k:=2 to i do
if (j mod k=0) and (i mod k=0) then
inc(d);
if d=0 then
inc(c);
end
else
begin
d:=0;
for k:=2 to j do
if (i mod k=0) and (j mod k=0) then
inc(d);
if d=0 then
inc(c);
end;
end;
assign(f,'fractii.out');
rewrite(f);
write(f,c);
close(f);
end.