Вопрос задан 27.04.2019 в 11:33. Предмет Информатика. Спрашивает Борисов Егор.

Паскаль... нужно сделать так чтобы введённые числа... вышли наоборот... типо вводим 1 2 5 7 9... а

выйти в обратном порядке 9 7 5 2 1
0 0
Перейти к ответам

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

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

begin
  ReadSeqInteger(ReadInteger('n=')).Reverse.Println;
end.

Пример
n= 5
1 2 5 7 9
9 7 5 2 1
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Reversing Input Numbers in Pascal

To reverse the input numbers in Pascal, you can use an array to store the input numbers and then print them out in reverse order. Here's a simple example of how you can achieve this in Pascal:

```pascal program ReverseNumbers;

var numbers: array[1..5] of Integer; // Assuming 5 input numbers i: Integer;

begin // Input numbers writeln('Enter 5 numbers:'); for i := 1 to 5 do readln(numbers[i]);

// Output numbers in reverse order writeln('Numbers in reverse order:'); for i := 5 downto 1 do writeln(numbers[i]);

end. ```

In this example, we declare an array `numbers` to store the input numbers. We then use a loop to read the input numbers and another loop to print them out in reverse order.

This program assumes 5 input numbers. If you need to handle a different number of input numbers, you can modify the array size and the loop limits accordingly.

I hope this helps! Let me know if you have further questions or need additional assistance.

0 0

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

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

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