I've tested it and it works, don't know where the problem is.
I tested line 20 also with
maximum = number;
because at first I thought that the first number was to be considered for the maximum, but after reading the comments I understood it doesn't have to.
Thanks
package com.codegym.task.task05.task0532;
import java.lang.*;
import java.util.Scanner;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
int number;
int maximum;
number = scanner.nextInt();
if (number > 0) {
maximum = Integer.MIN_VALUE;
while (scanner.hasNextInt()) {
number = scanner.nextInt();
if (number > maximum) {
maximum = number;
} else {
//do nothing, continue with the next int
}
}
System.out.println(maximum);
} else {
// do nothing, this satisfies the last requirement
}
}
}