Вопрос задан 31.07.2018 в 16:18. Предмет Информатика. Спрашивает Арнаут Ярослава.

Программа для перевода сантиметров в метры с помощью div и mod (Паскаль).Заранее спасибо!

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

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Шапов Павел.
Var a,b,c:integer;
Begin writeln('Введите длину в сантиметрах');
readln(a);
b:=a div 100;
c:=a mod 100;
writeln(a,' см = ', b, ',', c, ' м');
End.

Результат выполнения см. на рисунке

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

Program for converting centimeters to meters using div and mod (Pascal)

To convert centimeters to meters using the div and mod operators in Pascal, you can use the following program:

```pascal program ConvertCentimetersToMeters; var centimeters, meters, remainder: integer; begin writeln('Enter the length in centimeters: '); readln(centimeters);

meters := centimeters div 100; // Divide by 100 to get the number of meters remainder := centimeters mod 100; // Use the mod operator to get the remaining centimeters

writeln('Length in meters: ', meters); writeln('Remaining centimeters: ', remainder); end. ```

In this program, the user is prompted to enter the length in centimeters. The program then divides the input by 100 using the div operator to get the number of meters. The mod operator is used to calculate the remaining centimeters. The results are then displayed on the screen.

Please note that this program assumes the input is an integer value representing the length in centimeters.

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

0 0

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

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

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