Dennnhhhickk

Untitled

Oct 7th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. program Main;
  2. var
  3. s:string;
  4.  
  5. begin
  6. readln(n);
  7. for i:= 1 ton do
  8. readln(a[i]);
  9. maxs := '';
  10.  
  11. for i := 1 to n-1 do
  12. begin
  13. s:= intotstr(a[i]);
  14. for j := i+1 to n do
  15. for z := j to n do
  16. begin
  17. if a[z] < last then
  18. begin
  19. last:= a[z];
  20. s := s + ' ' + intotstr(a[z]);
  21. end;
  22. if z = n then
  23. if maxs < s then
  24. maxs := s;
  25. end;
  26. end;
  27.  
  28. end.
Advertisement
Add Comment
Please, Sign In to add comment