Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- dayso: array[1..100] of Integer;
- j, key, k, i, soChuSo: integer;
- BEGIN
- read(soChuSo);
- for k:=1 to soChuSo do read(dayso[k]);
- for i:=2 to soChuSo do begin
- key:=dayso[i];
- j:=i-1;
- while (j > 0) and (dayso[j] > key) do begin
- dayso[j+1]:=dayso[j];
- j:=j-1;
- end;
- dayso[j+1]:=key;
- end;
- for k:=1 to soChuSo do write(dayso[k] ,' ');
- END.
Advertisement
Add Comment
Please, Sign In to add comment