Pagini recente » Cod sursa (job #77644) | Cod sursa (job #64377) | Cod sursa (job #2124984) | Cod sursa (job #381339) | Cod sursa (job #345150)
Cod sursa(job #345150)
program fractii;
var n,p,q,i,l,max:longint;f,g:text;a:byte;
begin
assign(f,'fractii.in');reset(f);
assign(g,'fractii.out');rewrite(g);
readln(f,n);
while p<n do begin
inc(p);q:=0;
while q<n do begin
inc(q);if p>q then max:=p else max:=q;i:=2;
while i<=max do begin
if (p mod i=0)and(q mod i=0)then a:=1;inc(i);end;
if a=0 then inc(l); a:=0;
end;
end;
write(g,l);
close(f);
close(g);
end.