Pagini recente » Cod sursa (job #2028575) | Cod sursa (job #3231214) | Cod sursa (job #2520595) | Cod sursa (job #936278) | Cod sursa (job #2129507)
program p1 ;
var k,n:longint;
g,h:text;
procedure frac;
var i,j:integer;
begin
for i:=1 to n do begin
for j:=1 to n do begin
if not(i mod j=0) then
if not((i mod 2 =0) and (j mod 2 = 0)) then
if not((i mod 3 =0) and (j mod 3 = 0)) then
if not((i mod 5 =0) and (j mod 5 = 0)) then begin
inc(k);end;
if j=1 then inc(k);
end;
end;
end;
begin
assign (g,'fractii.in');
reset(g);
readln(g,n);
if (n>=1) and (n<=1000000) then
frac;
close(g);
assign (h,'fractii.out');
rewrite(h);
writeln (h,k);
close(h);
end.