Problem

3/10

Getting an element

Theory Click to read/hide

To get the value of an element from an ArrayList, use the  get(index)
method For example:

int a = arr. get(0);

To find out the number of elements in an array, you can use the size() method
For example:
int count = arr. size();

Problem

Iterate through all the values ​​of the ArrayList and output only the positive elements.

Input: The first line is the number of elements in the array. The second line contains the elements of the array.

Output: print only the positive elements from the sequence into a string.
 
Examples
# Input Output
1 4
2 -4 0 100
2 100