Решите в Pascal: известно расстояние до каждого из трёх сёл от районного центра. Определить, какое из них находится ближе всего к районному центру, а какое дальше всего от него

11 Окт 2019 в 23:42
164 +1
0
Ответы
1

program closest_village;

var
distance1, distance2, distance3: integer;

begin
writeln('Enter the distance to the first village:');
readln(distance1);

writeln('Enter the distance to the second village:');
readln(distance2);

writeln('Enter the distance to the third village:');
readln(distance3);

if (distance1 < distance2) and (distance1 < distance3) then
writeln('The first village is closest to the district center.');
if (distance2 < distance1) and (distance2 < distance3) then
writeln('The second village is closest to the district center.');
if (distance3 < distance1) and (distance3 < distance2) then
writeln('The third village is closest to the district center.');

if (distance1 > distance2) and (distance1 > distance3) then
writeln('The first village is farthest from the district center.');
if (distance2 > distance1) and (distance2 > distance3) then
writeln('The second village is farthest from the district center.');
if (distance3 > distance1) and (distance3 > distance2) then
writeln('The third village is farthest from the district center.');

end.

19 Апр в 12:01
Не можешь разобраться в этой теме?
Обратись за помощью к экспертам
Название заказа не должно быть пустым
Введите email
Бесплатные доработки
Гарантированные бесплатные доработки
Быстрое выполнение
Быстрое выполнение от 2 часов
Проверка работы
Проверка работы на плагиат
Интересные статьи из справочника
Поможем написать учебную работу
Название заказа не должно быть пустым
Введите email
Доверьте свою работу экспертам
Разместите заказ
Наша система отправит ваш заказ на оценку 84 654 авторам
Первые отклики появятся уже в течение 10 минут
Прямой эфир