I changed my code several times after reading discussions but I'm still stuck. How do I solve this problem!!???
package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(reader.readLine());
int maximum = num ;
int count = 0;
while (count < num)
{
int input = Integer.parseInt(reader.readLine());
if(input > maximum)
maximum = input;
count++;
}
//write your code here
System.out.println(maximum);
}
}