1.Вычислить сумму ряда s= cos(x)+cos(x)*cos(x)+...+cos(x)*cos(x)*...*cos(x), для x и n введенных с клавиатуры.
Ответы
Ответ дал:
0
Var x, n, i, j, r: Integer;
sum, temp: Double;
begin
ReadLn(x, n);
sum:=0;
r:=cos(x);
for i:=1 to n do begin
temp:=r;
for j:=1 to i do temp:=temp*temp;
sum:=sum+temp;
end;
WriteLn(sum);
end.
sum, temp: Double;
begin
ReadLn(x, n);
sum:=0;
r:=cos(x);
for i:=1 to n do begin
temp:=r;
for j:=1 to i do temp:=temp*temp;
sum:=sum+temp;
end;
WriteLn(sum);
end.
Ответ дал:
0
Сейчас напишу)
Ответ дал:
0
Var n, i: Integer;
x, sum, temp, cosx: Double;
begin
ReadLn(x, n);
sum:=0;
cosx:=cos(x);
temp:=1;
for i:=1 to n do begin
temp:=temp*cosx;
sum:=sum+temp;
end;
WriteLn(sum);
end.
x, sum, temp, cosx: Double;
begin
ReadLn(x, n);
sum:=0;
cosx:=cos(x);
temp:=1;
for i:=1 to n do begin
temp:=temp*cosx;
sum:=sum+temp;
end;
WriteLn(sum);
end.
Вас заинтересует
2 года назад
2 года назад
8 лет назад
8 лет назад
10 лет назад
10 лет назад
10 лет назад