int firstPositive(int A[], int n) { for(int i = 0; i < n; i++) { if(A[i] > 0) { return A[i]; } } return 0; }