BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = 0 ;
int n=-1;
while(n<=0) {
n = Integer.parseInt(reader.readLine());
}
if(n>0)
{
for (int i = 0; i < n; i++) {
int x = Integer.parseInt(reader.readLine());
if (x > maximum)
maximum = x;
}
System.out.println(maximum);
}
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 maximum = 0 ;
int n=-1;
while(n<=0) {
n = Integer.parseInt(reader.readLine());
}
if(n>0)
{
for (int i = 0; i < n; i++) {
int x = Integer.parseInt(reader.readLine());
if (x > maximum)
maximum = x;
}
System.out.println(maximum);
}
}
}