begin writeln('Задача 1, введите n ='); read(n); for i := 1 to n do if i mod 2 = 0 then x := x + 1 / (2 * i + 1) else x := x - 1 / (2 * i + 1); writeln('Sum = ', x);
writeln('Задача 2, введите a, b, c, d ='); read(a, b, c, d); for i := a to b do if i mod c = d then writeln(i);
writeln('Задача 3, введите n и n чисел ='); read(n); a := 0; b := 0; c := 0; for i := 1 to n do begin read(p); if p = 0 then a := a + 1 else if p < 0 then b := b + 1 else if p > 0 then c := c + 1; end; writeln(a, ' ', b, ' ', c);
writeln('Задача 5, введите x, p ,y ='); read(x, p, y); n := 0; repeat x := round(x * (100 + p)) / 100; n := n + 1; until x >= y; writeln(n, ' лет');
writeln('Задача 6, введите A, B ='); read(a, b); repeat if (a mod 2 = 0) and (a div 2 >= b) then begin writeln(a, ' : 2 = ', a div 2); a := a div 2 end else begin writeln(a, ' - 1 = ', a - 1); a := a - 1; end; until a <= b; end.
begin writeln('Задача 1, введите n ='); read(n); for i := 1 to n do if i mod 2 = 0 then x := x + 1 / (2 * i + 1) else x := x - 1 / (2 * i + 1); writeln('Sum = ', x);
writeln('Задача 2, введите a, b, c, d ='); read(a, b, c, d); for i := a to b do if i mod c = d then writeln(i);
writeln('Задача 3, введите n и n чисел ='); read(n); a := 0; b := 0; c := 0; for i := 1 to n do begin read(p); if p = 0 then a := a + 1 else if p < 0 then b := b + 1 else if p > 0 then c := c + 1; end; writeln(a, ' ', b, ' ', c);
writeln('Задача 5, введите x, p ,y ='); read(x, p, y); n := 0; repeat x := round(x * (100 + p)) / 100; n := n + 1; until x >= y; writeln(n, ' лет');
writeln('Задача 6, введите A, B ='); read(a, b); repeat if (a mod 2 = 0) and (a div 2 >= b) then begin writeln(a, ' : 2 = ', a div 2); a := a div 2 end else begin writeln(a, ' - 1 = ', a - 1); a := a - 1; end; until a <= b; end.
a, b, c, d, i, n, p: integer;
x, y: real;
begin
writeln('Задача 1, введите n =');
read(n);
for i := 1 to n do
if i mod 2 = 0 then
x := x + 1 / (2 * i + 1)
else x := x - 1 / (2 * i + 1);
writeln('Sum = ', x);
writeln('Задача 2, введите a, b, c, d =');
read(a, b, c, d);
for i := a to b do
if i mod c = d then writeln(i);
writeln('Задача 3, введите n и n чисел =');
read(n);
a := 0; b := 0; c := 0;
for i := 1 to n do
begin
read(p);
if p = 0 then a := a + 1
else if p < 0 then b := b + 1
else if p > 0 then c := c + 1;
end;
writeln(a, ' ', b, ' ', c);
writeln('Задача 5, введите x, p ,y =');
read(x, p, y);
n := 0;
repeat
x := round(x * (100 + p)) / 100;
n := n + 1;
until x >= y;
writeln(n, ' лет');
writeln('Задача 6, введите A, B =');
read(a, b);
repeat
if (a mod 2 = 0) and (a div 2 >= b) then begin
writeln(a, ' : 2 = ', a div 2);
a := a div 2
end
else begin
writeln(a, ' - 1 = ', a - 1);
a := a - 1;
end;
until a <= b;
end.
a, b, c, d, i, n, p: integer;
x, y: real;
begin
writeln('Задача 1, введите n =');
read(n);
for i := 1 to n do
if i mod 2 = 0 then
x := x + 1 / (2 * i + 1)
else x := x - 1 / (2 * i + 1);
writeln('Sum = ', x);
writeln('Задача 2, введите a, b, c, d =');
read(a, b, c, d);
for i := a to b do
if i mod c = d then writeln(i);
writeln('Задача 3, введите n и n чисел =');
read(n);
a := 0; b := 0; c := 0;
for i := 1 to n do
begin
read(p);
if p = 0 then a := a + 1
else if p < 0 then b := b + 1
else if p > 0 then c := c + 1;
end;
writeln(a, ' ', b, ' ', c);
writeln('Задача 5, введите x, p ,y =');
read(x, p, y);
n := 0;
repeat
x := round(x * (100 + p)) / 100;
n := n + 1;
until x >= y;
writeln(n, ' лет');
writeln('Задача 6, введите A, B =');
read(a, b);
repeat
if (a mod 2 = 0) and (a div 2 >= b) then begin
writeln(a, ' : 2 = ', a div 2);
a := a div 2
end
else begin
writeln(a, ' - 1 = ', a - 1);
a := a - 1;
end;
until a <= b;
end.