program ctdt;
uses crt;
type mang=array[1..10]of integer;
var a,b,min,x,y,i,j,tam:integer;
t,t1:mang;
(*------------------------*)
BEGIN
clrscr;
(*cau a*)
write('nhap 2 so:');readln(a,b);
if a>b then writeln(a,' lon hon ',b);
if a=b then writeln(a,' bang ',b);
if a<b then writeln(a,' nho thua ,b);
(*cau b*)
for i:=1 to 4 do {dua 4 so vao 1 mang}
begin
write(so thu ',i,' :');readln(t[i]);
end;
min:=t[1];
for i:=2 to 4 do
if t[i]<min then min:=t[i];
writeln('so nho nhat trong bon so:',min);
(*cau c*)
write('nhap hai so x,y:');readln(x,y);
if x>y then
begin
tam:=x;
x:=y;
y:=tam;
end;
(*cau d*)
for i:=1 to 3 do {dua 3 so vao mot mang}
begin
write(' so thu ',i,': ');readln(t1[i]);
end;
for i:=1 to 3-1 do
for j:=i+1 to 3 do
if t1[j]>t1[i] then
begin
tam:=t1[j];
t1[j]:=t1[i];
t1[i]:=tam;
end;
for i:=1 to 3 do
write(t1[i]);
readln;
end.
bai nay con vai loi sai nho
ban nen chay tung cau mot va khoa cac cau con lai bang lenh {...}