Created
February 18, 2015 21:00
-
-
Save hpetru/fa27cde912444bd70467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Program MIN_ION; | |
| const N = 2; | |
| type | |
| vec = array[1..N] of integer; | |
| function min(a, b: vec) : integer; | |
| var i : integer; | |
| var _min : integer; | |
| begin | |
| _min := a[1]; | |
| for i := 1 to N do begin | |
| if a[i] < _min then _min := a[i]; | |
| if b[i] < _min then _min := b[i]; | |
| end; | |
| min := _min; | |
| end; | |
| var a, b : vec; | |
| begin | |
| a[1] := 1; | |
| a[2] := 2; | |
| b[1] := 3; | |
| b[2] := 0; | |
| writeln(min(a, b)); | |
| writeln('Ion'); | |
| end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment