Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 13, 2020 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kryvoboker/b82d09301e5c7c91498f9c176b196e2c to your computer and use it in GitHub Desktop.
Save kryvoboker/b82d09301e5c7c91498f9c176b196e2c to your computer and use it in GitHub Desktop.
HomeWork6
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