Competitive Programming Solutions

GitHub
back to dashboard

E. Max

Codeforces - Sheet #2 (Loops) · limit: 1s · memory: 256MB · view on codeforces

input

5
1 8 5 7 5

output

8
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        int max = 0;
        while(n-- > 0){
            max = Math.max(max, in.nextInt());
        }
        out.println(max);

    }