Please help someone. I almost solved this task, but I can't create loop to automatically count lines.
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 {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = Integer.parseInt(reader.readLine());
if(maximum >0){
String aS;
int a;
int k = 0;
while(k<5){
aS = reader.readLine();
a = Integer.parseInt(aS);
maximum = maximum>a?maximum:a;
k++;
}
//write your code here
System.out.println(maximum);
}
}
}