Вопрос задан 18.06.2023 в 05:22. Предмет Информатика. Спрашивает Кот Даня.

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

Вывести в порядке убывания все целые числа, расположенные между х и у, а также количество этих чисел.
0 0
Перейти к ответам

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

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

Ответ:

в общем,вот код на питоне ..на Паскале ,к сожалению не смогу

Объяснение:

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 ('Кол-во чисел=',к)

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

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!

0 0

Похожие вопросы

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

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

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