各位义父,为啥我这个Java代码解题会显示编译失败,我自己的idea上可以正常使用啊
import java.util.Scanner;
public class unhappy {
public static void main (String []args){
Scanner scanner = new Scanner(System.in);
int now=0,max=0,sum;
for(int i = 1;i<8;i++){
int a = scanner.nextInt();
int b = scanner.nextInt();
sum = a + b;
if((sum>8)&&(sum>max)){
now=i;
max=sum;
}
}
System.out.println(now);
}
}