viet thuat toan giai bai toan .tim max cua 3 so nguyen a,b,c

2 câu trả lời

program baitap;

uses crt;

var a,b,c,max:real;

begin

clrscr;

writeln('nhap a,b,c:');

readln(a,b,c);

max:=0;

if (a>=b) and (a>=c) then max:=a;

if (b>=a) and (b>=c) then max:=a;

if (c>=a) and (c>=b) then max:=a;

writeln('so lon nhat la:',max:2:0);

readln

end.

program baitap;

uses crt;

var a,b,c,max:real;

begin

clrscr;

writeln('nhap a,b,c:');

readln(a,b,c);

max:=0;

if (a>=b) and (a>=c) then max:=a;

if (b>=a) and (b>=c) then max:=a;

if (c>=a) and (c>=b) then max:=a;

writeln('so lon nhat la:',max:2:0);

readln

end

Câu hỏi trong lớp Xem thêm