Pagini recente » Borderou de evaluare (job #2369904) | Cod sursa (job #309194) | Cod sursa (job #2311955) | Cod sursa (job #2138560) | Cod sursa (job #997407)
Cod sursa(job #997407)
var f,g:text;
n,i,s,j,c:integer;
begin
assign (f,'fractii.in'); reset (f);
assign (g,'fractii.out'); rewrite (g);
readln(f,n);
s:=((n-1)*2)+1;
c:=0;
for i:= 2 to n do
for j:= 2 to n do begin
if i=j then c:=1;
if i>j then begin if (i+j) mod j=0 then c:=1
else c:=0;end;
if i<j then begin if (i+j) mod i=0 then c:=1
else c:=0; end;
if c=0 then s:=s+1; end;
write (g,s);
close(f); close(g);
end.