BT Viet chuong trinh dung chuong trinh con nhap vao 3 so nguyen Tinh tong, hieu, tich, thuong, tbc cua 3 so nguyen do program ctc3songuyen; var a,b,c byte; {CTC nhap} procedure nhap(var a,b,c byte); b[.]
BT Viet chuong trinh dung chuong trinh nhap vao so nguyen.Tinh tong, hieu, tich, thuong, tbc cua so nguyen program ctc3songuyen; var a,b,c:byte; {CTC nhap} procedure nhap(var a,b,c:byte); begin writeln('nhap so nguyen'); readln(a,b,c); end; {CTC tinh tong} function tong(a,b,c:byte):word; begin tong:=a+b+c; end; {CTC tinh tich} function tich(a,b,c:byte):longint; begin tich:=a*b*c; end; {CTC tinh thuong} function thuong(a,b,c:byte):real; begin thuong:=a/b/c; end; {CTC tinh tbc} function tbc(a,b,c:byte):real; begin tbc:=(a+b+c)/3; end; {CTC tinh hieu} function hieu(a,b,c:byte):integer; begin hieu:=a-b-c; end; {CT chinh} begin nhap(a,b,c); writeln('tong so',tong(a,b,c)); writeln('tich so',tich(a,b,c)); writeln('thuong so',thuong(a,b,c):10:2); writeln('tbc so',tbc(a,b,c):10:2); writeln('hieu so',hieu(a,b,c)); readln; end ...function tbc(a,b,c:byte):real; begin tbc:=(a+b+c)/3; end; {CTC tinh hieu} function hieu(a,b,c:byte):integer; begin hieu:=a-b-c; end; {CT chinh} begin nhap(a,b,c); writeln(''tong so'',tong(a,b,c));