Предмет: Информатика, автор: dararatnikova13

СОСТАВЬТЕ ПРОГРАММЫ ПО ИНФОРМАТИКЕ(для паскаля), ПОЖАЛУЙСТА, ОЧЕНЬ НАДО!!! заранее спасибо тем, кто поможет, даю все баллы)​

Приложения:

restIess: язык?
dararatnikova13: Паскаль

Ответы

Автор ответа: restIess
1

Обе программы написаны и протестированы на PascalABC.NET 3.8.2

#1

var

 arr : array[1..31] of integer;

 temp : integer;

 begin

   randomize;

   write('Сгенерированный массив: ');

   for var i := 1 to 31 do

   begin

     arr[i] := random(88, 100);

     write(arr[i], ' ');

   end;

   

   for var i := 1 to 31 do

     for var j := 1 to 30 do

     begin

       if arr[j] < arr[j+1] then

       begin

         temp := arr[j];

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

         arr[j+1] := temp;

       end;

             

     end;

       writeln;

       write('Отсортированный массив: ');

       for var i := 1 to 31 do

         write(arr[i], ' ');

 end.

#2

var

 arr : array[1..500] of integer;

 temp : integer;

 begin

   randomize;

   writeln('Сгенерированный массив: ');

   for var i := 1 to 500 do

   begin

     arr[i] := i * 2 - 1;

     write(arr[i], ' ');

   end;

   

   for var i := 1 to 500 do

     for var j := 1 to 499 do

     begin

       if arr[j] < arr[j+1] then

       begin

         temp := arr[j];

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

         arr[j+1] := temp;

       end;

             

     end;

       writeln;

       writeln('Отсортированный массив: ');

       for var i := 1 to 500 do

         write(arr[i], ' ');

 end.


dararatnikova13: спасибо огромное)
Похожие вопросы
Предмет: Русский язык, автор: dariagrigoriev
Предмет: Английский язык, автор: Danila0007
Если не трудно помогите пожалуйста я же не зря потрачу все баллы 40 и спасибо вам сразу отмечу помогите!
Yesterday afternoon John’s mother was at work. John was at home with his father. They
watched TV together. Then his father said: “Let’s cook dinner for Mum and we can all have
dinner!” And they went to the kitchen. The father wanted to have some soup but John didn’t like
it. They decided to have fish. The father took the fish and they started cooking it together.
Then John went to his bedroom to do his homework. His father went to his room to read a
book. They didn’t go to the kitchen again.
After an hour, John’s mother came home. She was tired. But when she opened the door, she ran
to the kitchen and cried: “Oh, no!” The kitchen was very dirty. They couldn’t eat the fish
because it was black! John’s mother wasn’t happy. John and his father were sad, too.
But then, John and his father cleaned the kitchen and cooked a pizza for dinner.
Выбери правильный ответ в соответствии с прочитанным текстом.
1. Yesterday John was at home …
a) with his mother
b) with his father
c) with his mother and father
2. Yesterday John’s father said:
a) “Let’s cook dinner for Mum together”.
b) “Let’s do your homework together”.
c) “Let’s watch TV together”.
3. At first they decided to…
a) cook fish for dinner.
b) cook soup for lunch.
c) cook a pizza for dinner.
4. They started cooking fish and …
a) John went to his bedroom to read a book.
b) John went to his bedroom to watch TV.
c) John went to his bedroom to do his homework.
5. John’s mother was unhappy because…
a) John didn’t do his homework.
b) the kitchen was dirty.
c) John and his father cooked a pizza for dinner.