Вопрос задан 20.07.2023 в 04:34. Предмет Информатика. Спрашивает Колымова Таня.

Var k, m: integer; Dat: array(1..10) of integer; Begin Dat (1) i= 12; Dat (2) - 15; Dat (3) :=

17; Dat (4) re 15; Dat (5] : 14; Dat (6) := 12; Dat [7] := 10; Dat [8] : 13; Dat (9) * 14; Dat (10) * 15; m := 20; for k:=1 to 10 do if Dat (k) < m then begin m : Dat(k): end; writeln(m): End.
0 0
Перейти к ответам

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

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

Ответ:

m не меняется, поэтому будет напечатано 20

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

It seems like you have a Pascal code snippet. Let's go through the code step by step to understand what it does:

  1. Declare variables:

    • k and m are integer variables.
    • Dat is an array of integers with 10 elements.
  2. Assign values to the array Dat:

    • The code attempts to assign values to the array elements, but there are some syntax errors in the assignments. The correct assignments should be as follows:
pascal
Dat[1] := 12; Dat[2] := 15; Dat[3] := 17; Dat[4] := 15; Dat[5] := 14; Dat[6] := 12; Dat[7] := 10; Dat[8] := 13; Dat[9] := 14; Dat[10] := 15;
  1. Initialize m with the value 20.

  2. Loop through the Dat array:

    • The loop goes from k = 1 to 10.
    • For each element in Dat, it checks if the value is less than the value of m.
    • If the condition is true, it assigns the value of Dat(k) to m.
  3. Print the value of m.

After correcting the syntax errors, the code should look like this:

pascal
Var k, m: integer; Dat: array[1..10] of integer; Begin Dat[1] := 12; Dat[2] := 15; Dat[3] := 17; Dat[4] := 15; Dat[5] := 14; Dat[6] := 12; Dat[7] := 10; Dat[8] := 13; Dat[9] := 14; Dat[10] := 15; m := 20; for k := 1 to 10 do begin if Dat[k] < m then begin m := Dat[k]; end; end; writeln(m); End.

With the corrected code, the output will be the smallest value in the Dat array, which is 10.

0 0

Похожие вопросы

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

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

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