program summa;
var
sum:BigInteger;
i,n:integer;
begin
write ('n = ');
readln(n);
sum:=0;
i:=1;
while i<= n do begin
sum:=sum+i;
i:=i+1;
end;
writeln('Sum = ',sum);
end.
================================
program krugi;
uses graphabc;
var
x,y,r:integer;
begin
setBrushColor(clGreen);
x:=22; y:=22; r:=20;
while x<660 do begin
circle(x,y,r);
x:=x+40;
end;
end.
==============================
program factorial;
var
pr:BigInteger;
i,n:integer;
begin
write ('n = ');
readln(n);
pr:=1;
i:=1;
while i<= n do begin
pr:=pr*i;
i:=i+1;
end;
writeln('Факториал числа n! = ',pr);
end.
Для начала переведём эти числа в двоичную систему счисления:
36 = 100100 - A
4 = 100 - B
следовательно:
A +B = 101000
B - A = ....;
A * B = 10010000
A ∧ B= 10010000
A⊕B= 101000
Program YaBidlo;
Var
i, A: longint;
x,
u, j,
N, m : longint;
Function FDiv (A, left : LongInt) : LongInt;
var
d,
i : longint;
begin
d := 1;
for i := left to Trunc (Sqrt (A)) do
if (A mod i = 0)
then
begin
d := i;
Break;
end;
if (d <> 1)
then
FDiv := d
else
FDiv := A;
end;
Function g (N, u : longint) : longint;
var
i : longint;
begin
i := 0;
while (N mod u = 0)
do
begin
Inc (i);
N := N div u;
end;
g := i;
end;
Begin
Assign (Input, 'input.txt');
Assign (Output, 'output.txt');
Reset (Input);
Read (A);
Close (Input);
m := 0;
N := 1;
i := FDiv (A, 2);
u := 2;
while (A > 1)
do
begin
N := N * i;
j := 0;
while (A mod i = 0)
do
begin
Inc (j);
A := A div i;
end;
if (j > m)
then
begin
m := j;
u := i;
end;
i := FDiv (A, i + 2);
end;
x := 1;
while (g (N * x, u) * N * x < m)
do
Inc (x);
N := N * x;
ReWrite (Output);
Write (N);
Close (Output);
End.