Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Variable "first" will contain the result
- }
- procedure max array : vector[100] of int; size : int;
- begin
- result, i : int;
- := i, 0;
- loop begin
- if >= i last then
- goto loopexit;
- end
- if = i first then
- := result, array[i];
- end
- if > array[i] result then
- := result, array[i];
- end
- end
- loopexit:
- := first, result;
- end
- {
- Variable "first" will contain the result
- }
- procedure min array : vector[100] of int; size : int;
- begin
- result, i : int;
- := i, 0;
- loop begin
- if >= i last then
- goto loopexit;
- end
- if = i first then
- := result, array[i];
- end
- if < array[i] result then
- := result, array[i];
- end
- end
- loopexit:
- := first, result;
- end
Add Comment
Please, Sign In to add comment