1)
var
s : real;
i, n : integer;
begin
s := 0;
read (n);
for i := 1 to n do s := s + 1 / i;
writeln (s);
end.
2)
a, i : integer;
a := 1;
for i := 1 to 8 do
a := a * 2;
writeln ('Через ', i * 3, 'часов будет ', a, ' амеб');
end;
3)
n, i : integer;
x, s : real;
read (n, x);
for i := 1 to n do
s := s + sin (i * x);
4)
n, a, r, i : integer;
r := 1;
read (a, n);
for i := 1 to n do r := r * a;
writeln (r);
a : array [1..9] integer;
i : integer;
for i := 1 to 9 do
if i mod 3 = 1 then a[i] := i
else if i mod 3 = 2 then a[i] := sqr (i - 1)
else a[i] := a[i - 1] div i;
write (a[i], ' ');
b, a : array [1..15] of integer;
i, sa, sb : integer;
randomize;
sa := 0; sb := 0;
for i := 1 to 15 do
a[i] := trunc (random (100)) + 1;
sa := sa + a[i];
writeln;
b[i] := sqr (a[i]) - a[i]);
write (b[i], ' ');
sb := sb + b[i];
writeln (abs (sb - sa));
1)
var
s : real;
i, n : integer;
begin
s := 0;
read (n);
for i := 1 to n do s := s + 1 / i;
writeln (s);
end.
2)
var
a, i : integer;
begin
a := 1;
for i := 1 to 8 do
begin
a := a * 2;
writeln ('Через ', i * 3, 'часов будет ', a, ' амеб');
end;
end.
3)
var
n, i : integer;
x, s : real;
begin
s := 0;
read (n, x);
for i := 1 to n do
s := s + sin (i * x);
writeln (s);
end.
4)
var
n, a, r, i : integer;
begin
r := 1;
read (a, n);
for i := 1 to n do r := r * a;
writeln (r);
end.
var
a : array [1..9] integer;
i : integer;
begin
for i := 1 to 9 do
if i mod 3 = 1 then a[i] := i
else if i mod 3 = 2 then a[i] := sqr (i - 1)
else a[i] := a[i - 1] div i;
for i := 1 to 9 do
write (a[i], ' ');
end.
var
b, a : array [1..15] of integer;
i, sa, sb : integer;
begin
randomize;
sa := 0; sb := 0;
for i := 1 to 15 do
begin
a[i] := trunc (random (100)) + 1;
write (a[i], ' ');
sa := sa + a[i];
end;
writeln;
for i := 1 to 15 do
begin
b[i] := sqr (a[i]) - a[i]);
write (b[i], ' ');
sb := sb + b[i];
end;
writeln;
writeln (abs (sb - sa));
end.