(--------------------------------------------a-----------------------------------)
program ho_tro;
uses crt;
var a,h,s: integer;
begin
clrscr;
writeln(' nhap canh tam giac:'); readln(a);
writeln(' nhap chieu cao:'); readln(h);
s:= (a*h)/2;
writeln(' dien tich la:',s);
readln;
end.
(------------------------------------b---------------------------------------)
program ho_tro;
uses crt;
var a,b,c,d: integer;
begin
clrscr;
writeln(' nhap 2 so a va b:'); readln(a,b);
c:= a div b;
d:= a mod b;
writeln(' ket qua cua c la:',c);
writeln(' ket qua cua d la:',d);
readln;
end.
a)
uses crt;
var a,h:integer;
begin
clrscr;
write('a='); readln(a);
write('h='); readln(h);
if (a>0) and (h>0) then writeln('dien tich tam giac la: ',a*h/2:4:2)
else writeln('vui long nhap lai');
readln;
end.
b)
uses crt;
var c,d,a,b:integer;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
c:=a div b;
d:=a mod b;
writeln('thuong cua phep chia ',a,' cho ',b,' la: ',c);
writeln('so du cua phep chia ',a,' cho ',b,' la: ',d);
readln;
end.
a) Program bt;
Uses Crt;
Var a, h, S : real;
Begin
Clrscr;
Write(' nhap do dai canh a:'); Readln(a);
Writeln('nhap chieu cao:'); Readln(b);
S:= a*h/2;
Writeln('dien tich hinh tam giac',S);
Readln;
End.