Viết pascal tính trung bình cộng 2 số nguyên

2 câu trả lời

` @Chery `

program Pascal;

uses crt;

var a,b: integer;c:real;

begin

clrscr;

writeln('TINH TRUNG BINH CONG CUA HAI SO NGUYEN');

write('Nhap so nguyen thu 1: ');

readln(a);

write('Nhap so nguyen thu 2: ');

readln(b);

c:=(a+b)/2;

writeln('TRUNG BINH CONG CUA HAI SO NGUYEN = ',c:1:1);

readln;

end.

uses crt;
var a,b:longint;
begin
clrscr;
    read(a,b);
    writeln((a + b) div 2); 
readln; readln;
end.