I'm confused. I get the correct output but it doesn't pass the test. Can anyone help me with this?
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(System.in);
int max=0;
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int d = scan.nextInt();
int[] array = {a,b,c,d};
for(int k=0; k<array.length; k++) {
if(array[k] > 0 && array[k] > max)
max = array[k];
}
System.out.println(max);
}
}