And do you know what can you do, when you are in the same shoes as i, so you tried your program in many ways, and it's work, it's gives perfectly your waited result, but the task isn't satisfied in some way. It would be better if the task works like this:
The program should display the maximum of the N entered numbers. -> Test numbers: -3,-5,0,99,11 and the waited result: 99, and your result: 11.
package com.codegym.task.task05.task0532;
import java.io.*;
import java.util.Scanner;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner num = new Scanner(System.in);
int maximum = -2147483648;
int current;
//write your code here
while(num.hasNextLine()){
current = Integer.parseInt(num.nextLine());
if(current>=maximum){
maximum=current;
}
}
System.out.println(maximum);
}
}