Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- z:boolean;
- a, b, d:integer;
- Mass: array[1..100] of integer;
- Begin
- b:=0;
- repeat
- b:=b+1;
- read(a);
- Mass[b]:=a;
- until(a=0);
- repeat
- z:=true;
- for a:= 1 to (b-1) do
- begin
- if (Mass[a]<Mass[a+1]) then
- begin
- d:=Mass[a];
- Mass[a]:=Mass[a+1];
- Mass[a+1]:=d;
- z:=false;
- end;
- end;
- until(z=true);
- for a:= 1 to b do
- begin
- write(Mass[a]);
- write(' ');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement