Created
May 13, 2020 16:53
-
-
Save kryvoboker/b82d09301e5c7c91498f9c176b196e2c to your computer and use it in GitHub Desktop.
HomeWork6
This file contains 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
public class Main { | |
public static void main(String [] args) { | |
int [] array = new int[] {5, 3, 12, 55, 11, 0, 2}; | |
int max = massiv(array); | |
System.out.println(max); | |
} | |
public static int massiv(int[] array) { | |
int max = 0; | |
for (int i = 0; i < array.length; i++) { | |
if (array[i] > max) { | |
max = array[i]; | |
} | |
} | |
return max; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment