Pagini recente » Cod sursa (job #2888717) | Cod sursa (job #454605) | Cod sursa (job #2421060) | Cod sursa (job #1980438) | Cod sursa (job #2427348)
Program fractii;
var n,i,j,num,k:integer;
f1,f2:text;
begin
assign(f1,'fractii.in');
assign(f2,'fractii.out');
reset(f1);
rewrite(f2);
read(f1,n);
for i:=1 to n do
begin
for j:=1 to n do
begin
k:=k+1;
if ((i mod k)<>0) and ((j mod k)<>0) and ((j mod i)<>0) and ((i mod j)<>0) then
begin
num:=num+1;
if (i mod 2=0) and (j mod 2=0) then
num:=num-1;
end
else if j=1 then
begin
num:=num+1;
end;
if (i=1) and (j<>1) then
num:=num+1;
end;
end;
writeln(f2,num);
close(f1);
close(f2);
end.