Const e=0.001;
var a1,a2:real;n:integer;
begin
a1:=0.5;
a2:=sin(a1)/cos(a1)/2;
n:=2;
writeln(n,a2:7:4);
while abs(a2-a1)>=e do
begin
a1:=a2;
a2:=sin(a1)/cos(a1)/2;
n:=n+1;
writeln(n,a2:7:4);
end;
writeln('n = ',n);
end.
Результат:
<span>2 0.2732
3 0.1401
4 0.0705
5 0.0353
6 0.0177
7 0.0088
8 0.0044
9 0.0022
10 0.0011
11 0.0006
n = 11</span>
///////////////////////////////////
Ответ:
2550
Объяснение:
Алгоритм находим сумму вида 2+4+6+...+98+100.
Это сумма арифметической прогрессии и она равна
(2 + 100) / 2 × 50 = 102 / 2 × 50 = 51 × 50 = 2550
var
i, c : byte;
t : integer;
begin
c := 0;
for i := 1 to 10 do
begin
read (t);
if t mod 2 = 0 then inc (c);
end;
writeln (c);
end.
var
n, i : integer;
begin
read (n);
for i := 100 to 999 do
if i mod 10 + i div 10 mod 10 + i div 100 = n then writeln (i);
end.
var
i : integer;
begin
for i := 100 to 999 do
if i mod 10 = i div 100 then writeln (i);
end.
DIM p AS LONG
p = 1
FOR i = 5 TO 18 STEP 5
p = p * i
NEXT i
PRINT p