Pagini recente » Borderou de evaluare (job #453079) | Cod sursa (job #2343461) | Borderou de evaluare (job #2437322) | Borderou de evaluare (job #1013048) | Cod sursa (job #300544)
Cod sursa(job #300544)
var n,p,q,min,i,cnt:longint;
prim:boolean;
f,g:text;
begin
assign(f,'fractii.in');
assign(g,'fractii.out');
reset(f);
rewrite(g);
readln(f,n);
for p:=1 to n do
for q:=1 to n do
begin
if p<q then min:=p
else min:=q;
prim:=true;
for i:=2 to min do
if (p mod i=0) and (q mod i=0) then
begin
prim:=false;
break;
end;
if prim then inc(cnt);
end;
write(g,cnt);
end.