Odpowiedzi

2010-04-02T12:23:28+02:00
Program cc;
uses crt;
var
zn:array[1..3]of char;
t:array[1..3]of word;
t1:array[1..3]of byte;
i,j:byte;
pomzn:char;
pomt:word;
pomt1:word;
begin
clrscr;
for i:=1 to 3 do
begin
writeln('Wpisz znak: ');
readln(zn[i]);
if (ord(zn[i])>96) then t1[i]:=0 else t1[i]:=1;
zn[i]:=upcase(zn[i]);
t[i]:=ord(zn[i]);
end;
for i:=1 to 3 do
for j:=1 to 2 do
if t[j]>t[j+1] then
begin
pomt:=t[j];
t[j]:=t[j+1];
t[j+1]:=pomt;

pomt1:=t1[j];
t1[j]:=t1[j+1];
t1[j+1]:=pomt1;

pomzn:=zn[j];
zn[j]:=zn[j+1];
zn[j+1]:=pomzn;
end;
for i:=1 to 3 do
if t1[i]=0 then write(char(t[i]+32),' ')
else write(char(t[i]),' ');
repeat until keypressed;
end.