1)
var
x1, x2, y : real;
r1, r2 : byte;
begin
writeln('введите:');
write('X1 = ');
readln(x1);
write('X2 = ');
readln(x2);
write('R1 = ');
readln(r1);
write('R2 = ');
readln(r2);
y := Power(10, x1-r2)*(abs(x2-r1)/sin(degToRad(x2)));
writeln('Y = ', y);
end.
2)
var s : real;
for var n := 5 downto 1 do begin
var fac : integer := 1;
for var i := 1 to 2*n do fac *= i;
s += 1/fac;
end;
writeln(s);
3)
s, a, eps : real;
n : integer;
write('ввелте точность EPS = ');
readln(eps);
repeat
n += 1;
a := Power(-1, n-1)/sqr(n);
if abs(a) <= eps then s += a;
until abs(a) <= eps;
writeln('S = ', s);
надеюсь нигде в расчетах не накосячил...
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1)
var
x1, x2, y : real;
r1, r2 : byte;
begin
writeln('введите:');
write('X1 = ');
readln(x1);
write('X2 = ');
readln(x2);
write('R1 = ');
readln(r1);
write('R2 = ');
readln(r2);
y := Power(10, x1-r2)*(abs(x2-r1)/sin(degToRad(x2)));
writeln('Y = ', y);
end.
2)
var s : real;
begin
for var n := 5 downto 1 do begin
var fac : integer := 1;
for var i := 1 to 2*n do fac *= i;
s += 1/fac;
end;
writeln(s);
end.
3)
var
s, a, eps : real;
n : integer;
begin
write('ввелте точность EPS = ');
readln(eps);
repeat
n += 1;
a := Power(-1, n-1)/sqr(n);
if abs(a) <= eps then s += a;
until abs(a) <= eps;
writeln('S = ', s);
end.
надеюсь нигде в расчетах не накосячил...