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

Pascal ABC
Создать массив из 10 случайных чисел из интервала (-125;60].

Написать программу нахождения:

1) Наименьшего элемента массива и его номера;

2) Наименьшего элемента массива, кратного 6, и его номера.

3) Наибольшего чётного элемента массива.

Ответы

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

Программа:

Pascal:

var arr: array[1..10] of integer;

 i, min, minINDEX, minSIX, minSIXindex, max: integer;

begin

 min := MAXINT;  minSIX := MAXINT;  max := -MAXINT;

 

 for i := 1 to 10 do begin

   arr[i] := random(-124, 60);

   

   if arr[i] < min then begin

     min := arr[i];

     minINDEX := i;

   end;

   

   if (arr[i] mod 6 = 0) and (arr[i] < minSIX) then begin

     minSIX := arr[i];

     minSIXindex := i;

   end;

   

   if (arr[i] mod 2 = 0) and (arr[i] > max) then max := arr[i]

 end;

 

 writeln(arr);

 writeln('Наименьший элемент массива: ', min, ', индекс: ', minINDEX);

 writeln('Наименьший элемент массива, кратный 6: ', minSIX, ', индекс: ', minSIXindex);

 writeln('Наибольший чётный элемент массива: ', max);

end.

Интересные вопросы
Предмет: Русский язык, автор: 3698473675
Предмет: Английский язык, автор: Аноним
Помогите пожалуйста! английский язык, 8 класс, перевод текста и ответы на вопросы! пожалуйста!

Ancient Olympic

Probably the greatest honour 1 that can come to an athlete is to win gold
at the Olympic Games. But did you know that the idea of having Olympic Games is more than 2,500 years old?
A Greek legend says that it was Hercules son of Zeus,
who started Olympic Games. The earliest Olympic records [ˈrekɔ:dz] we
know about go back to the year 776 BC. The Greeks had the Games
once in every four years for more than 1,000 years, until the Romans
stopped them in 394 AD.
The ancient Greeks believed the Games so important that they measured
time by them. They called the four years an Olympiad. The Games were
an example of the Greek idea that people should develop their bodies as
well as brains. Nothing was serious enough to stand in the way of the
Games. If a war was going on in the country, they stopped the war, not
the Games.
The ancient Olympics had only one athletic competition — a running
race of about 183 metres (the length of the stadium). Only men could
take part in the Games. The powerful Spartans changed the programme
and included more sports in it. The winners of the Games became heroes in the country.
Задание под В:
Read the text again and make up questions to match the answers. 
Answers:
1) More than 2, 500 years old.
2) In Ancient Greece.
3) Every four years.
4) The Romans did.
5) To develop their bodies
6) It was a running rase.
7) No, they didn't. 
8) The winners did.
Предмет: Математика, автор: viola2390