Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Main;
- var
- s:string;
- begin
- readln(n);
- for i:= 1 ton do
- readln(a[i]);
- maxs := '';
- for i := 1 to n-1 do
- begin
- s:= intotstr(a[i]);
- for j := i+1 to n do
- for z := j to n do
- begin
- if a[z] < last then
- begin
- last:= a[z];
- s := s + ' ' + intotstr(a[z]);
- end;
- if z = n then
- if maxs < s then
- maxs := s;
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment