
ДАЮ 100 БАЛЛОВ! ИНФОРМАТИКА! ОЧЕНЬ СРОЧНО НУЖНА ПОМОЩЬ! Заданы числа а и b. Написать программу,
которая определит, эти числа одного или разных знаков (положительные/отрицательные) Задание нужно решить в программе Паскаль!!! 

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

Ответ:
// PascalABC.NET 3.1, сборка 1239 от 08.05.2016
begin
var a,b:real;
Write('Введите два числа через пробел: ');
Read(a,b);
if a*b>0 then Writeln('Числа одного знака')
else Writeln('Числа разных знаков')
end.
Объяснение:



Program to Determine the Signs of Numbers
To write a program in Pascal that determines whether two given numbers, `a` and `b`, have the same or different signs (positive/negative), you can use the following code:
```pascal program DetermineSigns; var a, b: integer; begin writeln('Enter the value of a: '); readln(a); writeln('Enter the value of b: '); readln(b); if (a > 0) and (b > 0) then writeln('Both numbers are positive.') else if (a < 0) and (b < 0) then writeln('Both numbers are negative.') else writeln('The numbers have different signs.'); end. ```
This program prompts the user to enter the values of `a` and `b`. It then checks the conditions using `if` statements to determine whether both numbers are positive, both are negative, or they have different signs. The program then outputs the corresponding message.
Please note that this program assumes the input numbers are integers. If you need to handle decimal numbers, you can modify the program accordingly.
I hope this helps! Let me know if you have any further questions.


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