-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray27.java
More file actions
23 lines (22 loc) · 565 Bytes
/
Array27.java
File metadata and controls
23 lines (22 loc) · 565 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array27
* Copyright © : 6/23/2022
*/
public class Array27 {
public static void main(String[] args) {
array(new int[]{-1,-3,-2,-6,2,3,4,5,6});
}
public static void array(int []array){
boolean n;
int i;
n=(array[1]>0);
for ( i = 2;( i < array.length) && (n!=array[i]>0) ; i++) {
n=array[i]>0;
}
if (i==array.length+1) System.out.println(0);
else System.out.println(i);
}
}