{F.5CA Winnie Leung (21)} Program B_Sort_name; uses wincrt; Var Name:array[1..10] of string; i,N_person,flag,pass:integer; temp:string; Begin Name[1]:='Robin Gibb';Name[2]:='John Lennon'; Name[3]:='Tom Cruise';Name[4]:='Barbara Stryson'; Name[5]:='Mary Hopkins'; Writeln('The name list before sorting : '); N_person:=5; For i:=1 to N_person do writeln(name[i]); For pass:=1 to N_person - 1 do begin flag:=0; For i:=1 to N_person - pass do begin If name[i]>name[i+1] then begin temp:=name[i+1]; name[i+1]:=name[i]; name[i]:=temp; flag:=1 end; If i=N_person - pass then begin If flag=0 then begin writeln; Writeln('The name list in ascending order'); For i:=1 to 5 do writeln(name[i]) end; end; end; end end.