I tested to make sure if the it showed the greatest number and does not display anything equal to or less than 0.
package com.codegym.task.task05.task0532;
import java.util.Scanner;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
int maximum = input.nextInt();
int num;
while(input.hasNextInt()){
num = input.nextInt();
if(num > maximum)
maximum = num;
}// end while
if(maximum > 0)
System.out.println(maximum);
}
}