Pagini recente » Cod sursa (job #1359310) | Cod sursa (job #2104183) | Cod sursa (job #814107) | Cod sursa (job #2543370) | Cod sursa (job #268026)
Cod sursa(job #268026)
type ta=array [1..1000000] of 0..1;
ta2=array [1..1000000] of int64;
var f:text;
d,suma,n,cop,p:int64;
i,j:longint;
a:ta;
t:ta2;
begin
assign(f,'fractii.in');reset(f);
read(f,n);
close(f);
for i:=2 to n do
if a[i]=0 then
for j:=2 to (n div i) do
a[i*j]:=1;
suma:=1;
for i:=1 to n do
begin
if a[i]=0 then t[i]:=i-1
else
suma:=suma+t[i];
end;
assign(f,'fractii.out');rewrite(f);
close(f);
end.