7 задача 9 урок
Primary tabs
Пользователь вводит четыре числа, найдите из них максимальное
var a,b,c,d,max,max1,max2,max3:integer; begin writeln('Vedite chislo a'); readln(a); writeln('Vedite chislo b'); readln(b); writeln('Vedite chislo c'); readln(c); writeln('Vedite chislo d'); readln(d); if (a>b)then max1:=a else max1:=b; if (max1>c)then max2:=max1 else max2:=c; if (max2>d)then max3:=max2 else max3:=d; max:=max3; writeln('vivoditsya bolsshee chislo: ',max); readln(); end.
вывод консоли
Vedite chislo a 14 Vedite chislo b 2 Vedite chislo c 15 Vedite chislo d 8 vivoditsya bolsshee chislo: 15
- Log in to post comments
- 643 reads