Pagini recente » Cod sursa (job #1202463) | Cod sursa (job #2795367) | Cod sursa (job #2339625) | Cod sursa (job #2425043) | Cod sursa (job #179785)
Cod sursa(job #179785)
program fractii;
var a,b,x,y,i,n,r,min,k :longint;
f,g:text;
ok:boolean;
begin
assign(f,'fractii.in');
assign(g,'fractii.out');
reset(f);
rewrite(g);
read(f,n);
close(f);
i:=0;
for x:=1 to n do
begin
for y:=1 to n do
begin
if (x mod 2<>0) or (y mod 2<>0) then
begin
a:=x;
b:=y;
if a>b then min:=b
else min:=a;
ok:=true;
k:=2;
while (k<=min) and (ok=true) do
begin
if (a mod k=0) and (b mod k=0) then ok:=false;
k:=k+1;
end;
if ok then i:=i+1;
end;
end;
end;
write(g,i);
close(g);
end.