
Написать цикл с пост условием решения задач на языке паскаль. Даны действительные числа x, y.
Вывести в порядке убывания все целые числа, расположенные между х и у, а также количество этих чисел.

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

Ответ:
в общем,вот код на питоне ..на Паскале ,к сожалению не смогу
Объяснение:
x=float (input())
y=float (input())
k=0
if x > =y :
a=int (x//1)
b=int (y//1)
for I in range (a-1,b,-1)
print (i)
k=k+1
print ( 'Koл-во чисел=',к)
else:
a=int(x//1)
b=int(y//1)
for i in range (b-1,a,-1):
print (i)
k=k+1
. print ('Кол-во чисел=',к)



Pascal Code for Printing Integers between x and y in Descending Order
Here is a Pascal code snippet that solves the given problem:
```pascal program PrintIntegers; var x, y, i, count: integer; begin // Input the values of x and y write('Enter the value of x: '); readln(x); write('Enter the value of y: '); readln(y); // Print the integers between x and y in descending order count := 0; if x > y then begin for i := x - 1 downto y + 1 do begin writeln(i); count := count + 1; end; end else begin for i := y - 1 downto x + 1 do begin writeln(i); count := count + 1; end; end; // Print the count of integers between x and y writeln('Count:', count); end. ```
This code prompts the user to enter the values of `x` and `y`. It then prints all the integers between `x` and `y` (excluding `x` and `y`) in descending order and also counts the number of integers printed. The code handles cases where `x` is greater than `y` and vice versa.
Please note that this code assumes that the input values of `x` and `y` are valid integers.
Let me know if you need any further assistance!


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







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