roma8
?>

Вычислить s= cos(x) + cos(x+1) + cos(x+2) + cos (x+n) n-натуральное число

Информатика

Ответы

darialyagina

===== PascalABC.NET =====

begin

 var n := ReadInteger('n =');

 var x := ReadReal('x =');

 var s := Cos(x);

 for var i := 1 to n do

   s += Cos(x + i);

 s.Println

end.


Вычислить s= cos(x) + cos(x+1) + cos(x+2) + cos (x+n) n-натуральное число
dmitrovlug8248

Program fantscrin;

 const n = 10;

 Var a: array [1..n] of integer;

     i,j,k:integer; s:real;

Begin

 for i:=1 to n do

   a[i]:=random(20)-10;

 for i:=1 to n do

   write(a[i], '  ');

 for i:=1 to n do

   for j:=1 to n-1 do

     if (a[j]<a[j+1]) then

                      begin

                       k:=a[j];

                       a[j]:=a[j+1];

                       a[j+1]:=k;

                      end;

 writeln('');

 for i:=1 to n do

   write(a[i], '  ');

 s:=0;

 for i:=1 to n do

   if ((a[i] < 0)and(i mod 2=0)) then s:=s+1;

 writeln('');

 writeln(s);

End.

Кристина910

Program fantscrin;

 const n = 10;

 Var a: array [1..n] of integer;

     i,j,k:integer; s:real;

Begin

 for i:=1 to n do

   a[i]:=random(20)-10;

 for i:=1 to n do

   write(a[i], '  ');

 for i:=1 to n do

   for j:=1 to n-1 do

     if (a[j]<a[j+1]) then

                      begin

                       k:=a[j];

                       a[j]:=a[j+1];

                       a[j+1]:=k;

                      end;

 writeln('');

 for i:=1 to n do

   write(a[i], '  ');

 s:=0;

 for i:=1 to n do

   if ((a[i] < 0)and(i mod 2=0)) then s:=s+1;

 writeln('');

 writeln(s);

End.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Вычислить s= cos(x) + cos(x+1) + cos(x+2) + cos (x+n) n-натуральное число
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

anikamalish
happygal5224
danya1509379
Aleksandrovich-Yurevna1421
al2nik2ol
Nv-444
Шеина
targovich
oserdyuk41
elizabetmaslova3
pavelriga5
Vitalevna1186
ovdei71
Овсянкина407
bieku68