Răspuns :
o metoda mai exacta si o poti utiliza si pentru alte probleme
program p1;
var a,b,c,m,n,f:integer;
s:string;
Begin
write('Dati numerele a,b si c:');readln(a,b,c);
if (a>b) and (a>c) then m:=a
else if (b>a) and (b>c) then m:=b
else if (c>a) and (c>b) then m:=c;
if (a<b) and (a<c) then n:=a
else if (b<a) and (b<c) then n:=b
else if (c<a) and (c<b) then n:=c;
if (a>n) and (a<m) then f:=a
else if (b>n) and (b<m) then f:=b
else if (c>n) and (c<m) then f:=c;
if a=n then s:=s+'a'
else if b=n then s:=s+'b'
else if c=n then s:=s+'c';
if a=f then s:=s+'a'
else if b=f then s:=s+'b'
else if c=f then s:=s+'c';
if a=m then s:=s+'a'
else if b=m then s:=s+'b'
else if c=m then s:=s+'c';
writeln(s);
readln;
End.
dar o metoda mai simplificata
program p1;
var a,b,c:integer;
begin
write('Dati numerele a,b si c:');
readln(a,b,c);
if a<b then
begin
if a>c then writeln('cab')
else if b<c then writeln('abc')
else writeln('acb');
end
else
begin
if (b<c) and (a<c) and (a<b) then writeln('abc')
else if (a>c) and (c>b) then writeln('bca')
else if (c>b) and (a>b) then writeln('bac')
else if b>a then writeln('cab')
else writeln('cba');
end;
readln;
end.
program p1;
var a,b,c,m,n,f:integer;
s:string;
Begin
write('Dati numerele a,b si c:');readln(a,b,c);
if (a>b) and (a>c) then m:=a
else if (b>a) and (b>c) then m:=b
else if (c>a) and (c>b) then m:=c;
if (a<b) and (a<c) then n:=a
else if (b<a) and (b<c) then n:=b
else if (c<a) and (c<b) then n:=c;
if (a>n) and (a<m) then f:=a
else if (b>n) and (b<m) then f:=b
else if (c>n) and (c<m) then f:=c;
if a=n then s:=s+'a'
else if b=n then s:=s+'b'
else if c=n then s:=s+'c';
if a=f then s:=s+'a'
else if b=f then s:=s+'b'
else if c=f then s:=s+'c';
if a=m then s:=s+'a'
else if b=m then s:=s+'b'
else if c=m then s:=s+'c';
writeln(s);
readln;
End.
dar o metoda mai simplificata
program p1;
var a,b,c:integer;
begin
write('Dati numerele a,b si c:');
readln(a,b,c);
if a<b then
begin
if a>c then writeln('cab')
else if b<c then writeln('abc')
else writeln('acb');
end
else
begin
if (b<c) and (a<c) and (a<b) then writeln('abc')
else if (a>c) and (c>b) then writeln('bca')
else if (c>b) and (a>b) then writeln('bac')
else if b>a then writeln('cab')
else writeln('cba');
end;
readln;
end.