任何人都可以让我知道PFA代码的原因-
package stockprice;
import java.util.Scanner;
public class UserMainCode {
public int stocks(int input1, int[] input2) {
int temp = input2[0];
for (int i = 0; i < input2.length - 1; i++) {
for (int j = i+1; j < input2.length - 1; j++) {
if(temp<input2[j]) {
System.out.println(temp);
}else {
temp=temp+input2[j];
}
}
}
throw new UnsupportedOperationException("stocks(int input1, int[] input2)");
}
public static void main(String[] args) {
UserMainCode obMainCode = new UserMainCode();
Scanner inScanner = new Scanner(System.in);
int input1 = inScanner.nextInt();
int input2[] ;
input2 = new int[input1];
for (int i = 0; i <= input2.length - 1; i++) {
input2[i]=inScanner.nextInt();
}
obMainCode.stocks(input1, input2);
}
}