Вопрос задан 30.04.2019 в 04:18. Предмет Информатика. Спрашивает Nikulesko Vladimir.

Var k, m: integer;Dat: array[1..10] of integer;Begin Dat[1] := 16; Dat[2] := 20; Dat[3] := 20;

Dat[4] := 41; Dat[5] := 14; Dat[6] := 21; Dat[7] := 28; Dat[8] := 11; Dat[9] := 15; Dat[10] := 35; m := 50; for k := 1 to 10 do if Dat[k]<m then begin m := Dat[k] end; writeln(m);End.
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Палкина Алиса.
Ответ задачи равно 11
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Code Explanation

The given code is written in Pascal and aims to find the maximum value in the array `Dat` and store it in the variable `m`. Let's break down the code step by step:

1. Variable Declaration: - `Var k, m: integer;`: Declares two integer variables, `k` and `m`. - `Dat: array[1..10] of integer;`: Declares an array `Dat` of size 10 to store integers.

2. Array Initialization: - Initializes the array `Dat` with the given values: `Dat[1] := 16; Dat[2] := 20; Dat[3] := 20; Dat[4] := 41; Dat[5] := 14; Dat[6] := 21; Dat[7] := 28; Dat[8] := 11; Dat[9] := 15; Dat[10] := 35;`.

3. Finding Maximum: - Sets `m` to 50. - Iterates through the array `Dat` using a for loop from 1 to 10. - Checks if the current element of `Dat` is less than `m`. - If true, updates `m` with the value of the current element.

4. Output: - Outputs the value of `m`.

Pascal Code

```pascal Var k, m: integer; Dat: array[1..10] of integer; Begin Dat[1] := 16; Dat[2] := 20; Dat[3] := 20; Dat[4] := 41; Dat[5] := 14; Dat[6] := 21; Dat[7] := 28; Dat[8] := 11; Dat[9] := 15; Dat[10] := 35; m := 50; for k := 1 to 10 do if Dat[k] < m then begin m := Dat[k]; end; writeln(m); End. ```

The code initializes an array `Dat` with 10 integer values and then finds the minimum value in the array, storing it in the variable `m`. The output will be the minimum value found in the array `Dat`, which is 11.

Conclusion

The provided Pascal code initializes an array with 10 integer values and then finds the minimum value in the array, storing it in a variable.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос