Program Sosanhdiem;
uses crt;
var a,b,c: byte;
begin
clrscr;
writeln('Nhap lan luot so diem cua 3 ban'); readln(a,b,c);
if a>b >c then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', a, ' , ' , b , ' , ' ,c ) else
if a>c >b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', a, ' , ' , c , ' , ' ,b ) else
if b>a >c then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', b, ' , ' , a , ' , ' ,c ) else
if b>c >a then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', b, ' , ' , c , ' , ' ,a ) else
if c>a >b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', c, ' , ' , a , ' , ' ,b ) else
if c>b >a then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', c, ' , ' , b , ' , ' ,ba) else
if c>a and a=b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', c, ' , ' , a , ' , ' ,b ) else
if c<a and a=b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', b, ' , ' , a , ' , ' ,c ) else
if b>a and a=c then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', b, ' , ' , a , ' , ' ,c ) else
if b<a and a=c then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', c, ' , ' , a , ' , ' ,b ) else
if a>c and c=b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', a, ' , ' , c, ' , ' ,b ) else
if a<c and c=b then write(' Diem cua 3 ban xep theo thu tu tu lon de be la ', c, ' , ' , b , ' , ' ,a ) else
if a = b =c then write('Diem cua 3 ban bang nhau');
Readln;
end.
Chúc bạn học tốt
uses crt;
var a:array[1..3]of real;
tam:real;
i,j:integer;
begin
clrscr;
for i:=1 to 3 do
begin
repeat
write('so diem cua ban thu ',i,' la: '); readln(a[i]);
if (a[i]<0) or (a[i]>10) then writeln('vui long nhap lai');
until (a[i]>=0) and (a[i]<=10);
end;
for i:=1 to 2 do
for j:=i+1 to 3 do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('so diem cua 3 ban xep theo thu tu tu nho den lon la: ');
for i:=1 to 3 do
write(a[i]:4:2,' ');
readln;
end.
uses crt;
var a,cs:array[1..3]of real;
tam:real;
i,j:integer;
begin
clrscr;
for i:=1 to 3 do
begin
repeat
write('so diem cua ban thu ',i,' la: '); readln(a[i]);
cs[i]:=i;
if (a[i]<0) or (a[i]>10) then writeln('vui long nhap lai');
until (a[i]>=0) and (a[i]<=10);
end;
for i:=1 to 2 do
for j:=i+1 to 3 do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
tam:=cs[i];
cs[i]:=cs[j];
cs[j]:=tam;
end;
writeln('thu tu cua 3 ban xep theo thu tu tu nho den lon la: ');
for i:=1 to 3 do
writeln(cs[i]:0:0);
readln;
end.