Вопрос задан 21.03.2021 в 07:02. Предмет Информатика. Спрашивает Лузин Павел.

1 var s, n: integer; begin s := 25; n := 0; while 400 < s*s do begin s := s - 1; n := n +

3 end; writeln(n); end.
0 0
Перейти к ответам

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

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

В цикле указано, что пока S не станет меньше 400, будет отниматься 1 от S и прибавляться 3 к N, в итоге будет выведено 15.

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

This is a Pascal code snippet that initializes two integer variables s and n to the values of 25 and 0 respectively. It then enters a while loop which continues as long as the expression 400 < s*s evaluates to true.

Within the loop, the value of s is decreased by 1 and the value of n is increased by 3. This continues until the condition 400 < s*s is no longer true, at which point the loop is exited.

Finally, the value of n is output to the console using the writeln procedure.

Based on the logic of the code, it seems to be attempting to determine the number of times that the value of s can be decremented by 1 such that the square of s is greater than or equal to 400. Each time s is decremented, n is increased by 3. The final value of n represents the total number of times s was decremented.

Note that the code snippet doesn't include a program declaration, and is incomplete as is. To properly run this code, you'd need to wrap it in a program declaration with a main function and compile it using a Pascal compiler.

0 0

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

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

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