Duplicate local variable y
Duplicate local variable y ???? 怎么解决?
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double x = scanner.nextDouble();
double y = scanner.nextDouble();
double z = scanner.nextDouble();
scanner.close();
for(double x = 1; x <= 100/5; x++){
for(double y = 0; y <= 33; y++){
z = 100 - x - y;
if(5*x + 3*y + z/3 == 100 && z%3 == 0){
System.out.println("可买鸡翁只数: " + x);
System.out.println("可买鸡母只数: " + y);
System.out.println("可买鸡雏只数: " + z);
System.out.println();
}
}
}
}
}