code is working. where in mistake? or what i missed?
package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
//-- start 1 try ----------------------------------------
int N = 0;
int cc;
int x;
int i = 0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(reader.readLine());
if ( N <= 0) return;
cc = N;
x = N;
for (; i != cc; i++)
{
N = Integer.parseInt(reader.readLine());
if ( N > 0)
{
if ( N > x ) x = N;
}
} // for loop
System.out.println(x);
}
}
//------end 3 try-----------------
// ----- 2 test try -------------------------
/* // all in comment here below
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int F = Integer.parseInt(reader.readLine());
if ( F <= 0) return;
int i = 0;
int cc = F ;
int maximum = F;
int z = 0;
for (; i != cc; i++)
{
z = z + 1;
int N = Integer.parseInt(reader.readLine());
// --
if ( N > 0)
{
if ( N > maximum ) maximum = N;
}
else return;
// ---
if (N > 0) { if ( z < 2)
{
if (N > F) maximum = N; else maximum = F;
}
} else return;
if ( N > 0)
{
if ( N > maximum ) maximum = N;
}
else return;
} // while loop
// N = maximum;
System.out.println(maximum);
}
}
*/ // ---------- end 2 test try-----------