Câu 1:
program tam_giac;
var f,g:text;
a,b,c:integer;
begin
Assign(f,'BAI1.INP'); reset(f);
Assign(g,'BAI1.OUT'); rewrite(g);
readln(f,a,b,c);
if (a+b>c) and (a+c>b) and (b+c>a) and (a>0) and (b>0) and (c>0) then
begin
writeln(g,'La tam giac')
writeln(g,'Chu vi: 'a+b+c);
end
else writeln(g,'Khong phai tam giac');
close(f); close(g);
end.
Câu 2:
program tinh_t;
var a,b:integer;
{---Ham-binh-phuong---}
function bp(x:integer):longint;
begin
bp:=x*x;
end;
{---Ham-t---}
function t(a,b:integer):longint;
begin
t:=bp(a)+bp(b);
end;
{---Chuong-trinh-chinh---}
BEGIN
clrscr;
write('Nhap a: '); readln(a);
write('Nhap b: '); readln(b);
write('t= ',t(a,b));
readln;
end.