Program HOC24;
var a,b,c,d,max: integer;
t: longint;
begin
write('Nhap a; b; c; d: '); readln(a,b,c,d);
t:=a+b+c+d;
writeln('Tong 4 so tren la: ',t);
max:=a;
if max<b then max:=b;
if max<c then max:=c;
if max<d then max:=d;
write('So lon nhat cua chung la: ',max);
readln
end.
*Cách khác:
uses crt;
var a,b,c,d,max:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
write('Nhap d='); readln(d);
writeln('Tong cua 4 so la: ',a+b+c+d);
max:=a;
if max<b then max:=b;
if max<c then max:=c;
if max<d then max:=d;
writeln('Gia tri lon nhat la: ',max);
readln;
end.