public class Calculator public static int getIndexOfLast int temp int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public class Calculator {
public static int getIndexOfLast(int[] temp) {
int result = 0;
for (int i = (temp.length - 1); i >= 0; i--) {
if (temp[i] > 0) {
result = i;
break;
}
}
return result;
}
}