Вопрос задан 02.05.2019 в 02:33. Предмет Информатика. Спрашивает Бойцова Вероника.

Требуется использовать язык Паскаль Даны три целых числа A, B, C. Значения чисел вводятся с

клавиатуры. Определить количество нулей среди данных чисел. Результат вывести на экран.
0 0
Перейти к ответам

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

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

var a,k,i:integer;
begin
for i:=1 to 3 do begin
write('Введите число ',i,' = ');readln(a);
while a>10 do begin
if a mod 10 = 0 then k:=k+1;
a:=a div 10;
end;
end;
writeln('Кол-во нулей в данных числах = ',k);
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Task: Counting Zeros in Three Input Numbers

To solve this task in Pascal, we need to take three integers as input and then determine the number of zeros among these numbers. Let's proceed with the solution.

Pascal Code Solution

```pascal program CountZeros; var A, B, C, zeroCount: integer; begin writeln('Enter three integers: '); readln(A, B, C); zeroCount := 0; if A = 0 then zeroCount := zeroCount + 1; if B = 0 then zeroCount := zeroCount + 1; if C = 0 then zeroCount := zeroCount + 1; writeln('Number of zeros among the input numbers: ', zeroCount); end. ```

In this Pascal program, we declare four variables: A, B, C, and zeroCount. We then prompt the user to enter three integers and read them using the readln function. After that, we initialize zeroCount to 0 and check each input number for being zero. If any of the numbers are zero, we increment the zeroCount. Finally, we output the number of zeros among the input numbers.

I hope this helps! If you have any further questions or need additional assistance, feel free to ask.

0 0

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

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

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