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

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

// Внимание! Если программа не работает, обновите версию!
begin
ReadSeqInteger(ReadInteger('n=')).Reverse.Println;
end.
Пример
n= 5
1 2 5 7 9
9 7 5 2 1



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.


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







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili