Задача 7 Урок 9
Primary tabs
Задача 7 Урок 9Пользователь вводит четыре числа, найдите из них максимальное.
var a, b, c, d: integer; greater_ab, greater_cd, max: integer; begin writeln('Enter the first number'); readln (a); writeln('Enter the second number'); readln(b); writeln('Enter the third number'); readln(c); writeln('Enter the fourth number'); readln(c); if (a > b) then greater_ab := a else greater_ab := b; if (c > d) then greater_cd := c else greater_cd := d; if (greater_ab > greater_cd) then max := greater_ab else max := greater_cd; writeln('Maximum value: ', max); readln(); end.
- Log in to post comments
- 383 reads