Вопрос задан 10.08.2018 в 13:53. Предмет Информатика. Спрашивает Портнов Дима.

M[0]: = 11; M[1]: = 6; M[2]: =18; M[1]: = M[0]+M[2]; M[0]: = M[1] * M[2]; M[2]: = M[0] - M[1];

Введи значения, которые получат переменные массива после выполнения этого фрагмента программы. M[1] = ..... M[0] = ..... M[2] = .....
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Верховный Игорь.
Program massiv;
const N=4;
var i : integer;
M:array[-1..N]of integer;
begin
M[0]:=11;
M[1]:=6;
M[2]:=18;
M[1]:=M[0]+M[2];
M[0]:=M[1]*M[2];
M[2]:=M[0]-M[1];
writeln('M[1]= ',M[1]);
writeln('M[0]= ',M[0]);
writeln('M[2]= ',M[2]);
end.


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

Given Code Fragment:

``` M[0] += 11; M[1] += 6; M[2] += 18; M[1] += M[0] + M[2]; M[0] += M[1] * M[2]; M[2] += M[0] - M[1]; ```

To determine the values of the array variables `M[0]`, `M[1]`, and `M[2]` after executing this code fragment, let's go step by step.

1. After the first line of code, `M[0] += 11;`, the value of `M[0]` will be 11.

2. After the second line of code, `M[1] += 6;`, the value of `M[1]` will be 6.

3. After the third line of code, `M[2] += 18;`, the value of `M[2]` will be 18.

4. After the fourth line of code, `M[1] += M[0] + M[2];`, the value of `M[1]` will be the sum of `M[0]`, `M[1]`, and `M[2]`. Since `M[0]` is 11 and `M[2]` is 18, the value of `M[1]` will be 6 + 11 + 18 = 35.

5. After the fifth line of code, `M[0] += M[1] * M[2];`, the value of `M[0]` will be the sum of `M[0]` and the product of `M[1]` and `M[2]`. Since `M[1]` is 35 and `M[2]` is 18, the value of `M[0]` will be 11 + (35 * 18) = 641.

6. After the sixth line of code, `M[2] += M[0] - M[1];`, the value of `M[2]` will be the sum of `M[0]` and the difference between `M[0]` and `M[1]`. Since `M[0]` is 641 and `M[1]` is 35, the value of `M[2]` will be 18 + (641 - 35) = 624.

Therefore, the final values of the array variables `M[0]`, `M[1]`, and `M[2]` after executing this code fragment will be: - `M[0]` = 641 - `M[1]` = 35 - `M[2]` = 624

Please let me know if you need any further assistance!

0 0

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

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

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