I'm able to get the correct output but the requirements are still not met. What's wrong with my code? Thanks!
package com.codegym.task.task04.task0428;
/*
Positive number
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader KB = new BufferedReader(new InputStreamReader(System.in));
final int NUMBER_OF_USER_INPUTS = 3;
String[] userListString = new String[NUMBER_OF_USER_INPUTS];
int[] userListInt = new int[NUMBER_OF_USER_INPUTS];
int i;
int count = 0;
//get user string input and put into String array
for (i = 0; i < NUMBER_OF_USER_INPUTS; ++i) {
userListString[i] = KB.readLine();
}
//parse values in string array and put into integer array
for (i = 0; i < NUMBER_OF_USER_INPUTS; ++i) {
userListInt[i] = Integer.parseInt(userListString[i]);
}
//count the number of times a positive number is seen and print value
for (i = 0; i < NUMBER_OF_USER_INPUTS; ++i) {
if (userListInt[i] > 0) {
++count;
}
else {
count = 0;
}
}
System.out.print(count);
}
}