Вопрос задан 16.06.2023 в 19:47. Предмет Информатика. Спрашивает Дрожжинова Танюшка.

Составить программу выводящую на экран честные числа от 8 до 40 быстрее пожалуйста для паскаль

абц​
0 0
Перейти к ответам

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

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

я в паскале не очень понимаю, но думаю, как в питоне тебе нужно использовать циклы

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

Program to Display Honest Numbers from 8 to 40 in Pascal

To write a program in Pascal that displays honest numbers from 8 to 40, you can use a loop to iterate through the numbers and check if each number is honest. Here's an example program:

```pascal program HonestNumbers;

var num: integer;

function IsHonest(n: integer): boolean; var i: integer; begin IsHonest := true; for i := 2 to n - 1 do begin if (n mod i = 0) then begin IsHonest := false; break; end; end; end;

begin for num := 8 to 40 do begin if IsHonest(num) then writeln(num); end; end. ```

In this program, we define a function `IsHonest` that checks if a number is honest. A number is considered honest if it is not divisible by any number other than 1 and itself. We then use a loop to iterate through the numbers from 8 to 40 and print the honest numbers using the `writeln` statement.

Please note that this program assumes you are using a Pascal compiler that supports the `writeln` statement for output. The exact syntax may vary depending on the Pascal compiler you are using.

I hope this helps! Let me know if you have any further questions.

0 0

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

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

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

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