Guest User

Untitled

a guest
Jan 4th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. {
  2. Variable "first" will contain the result
  3. }
  4. procedure max array : vector[100] of int; size : int;
  5. begin
  6. result, i : int;
  7. := i, 0;
  8.  
  9. loop begin
  10. if >= i last then
  11. goto loopexit;
  12. end
  13.  
  14. if = i first then
  15. := result, array[i];
  16. end
  17.  
  18. if > array[i] result then
  19. := result, array[i];
  20. end
  21. end
  22. loopexit:
  23. := first, result;
  24. end
  25.  
  26. {
  27. Variable "first" will contain the result
  28. }
  29. procedure min array : vector[100] of int; size : int;
  30. begin
  31. result, i : int;
  32. := i, 0;
  33.  
  34. loop begin
  35. if >= i last then
  36. goto loopexit;
  37. end
  38.  
  39. if = i first then
  40. := result, array[i];
  41. end
  42.  
  43. if < array[i] result then
  44. := result, array[i];
  45. end
  46. end
  47. loopexit:
  48. := first, result;
  49. end
Add Comment
Please, Sign In to add comment