Java 我的节目没有结束
我的节目没有结束。我是一个初学者,很难理解为什么。在我更改名称之前,它工作正常,所以我将它复制到另一个文件,但它仍然没有结束Java 我的节目没有结束,java,while-loop,infinite-loop,Java,While Loop,Infinite Loop,我的节目没有结束。我是一个初学者,很难理解为什么。在我更改名称之前,它工作正常,所以我将它复制到另一个文件,但它仍然没有结束 import java.util.Scanner; public class Fan { public static void main (String[] args) { Scanner s = new Scanner(System.in); //first input System.out.println
import java.util.Scanner;
public class Fan
{
public static void main (String[] args)
{
Scanner s = new Scanner(System.in);
//first input
System.out.println("Enter your first input: ");
String first = s.nextLine();
String[] firstsplit = first.split(", ");
//second input
System.out.println("Enter your second input: ");
String second = s.nextLine();
String[] secondsplit = second.split(", ");
//third input
System.out.println("Enter your third input: ");
String third = s.nextLine();
String[] thirdsplit = third.split(", ");
//fourth input
System.out.println("Enter your fourth input: ");
String fourth = s.nextLine();
String[] fourthsplit = fourth.split(", ");
//fifth input
System.out.println("Enter your fifth input: ");
String fifth = s.nextLine();
String[] fifthsplit = fifth.split(", ");
for (int a = 0; a<=firstsplit.length-1; a++)
{
//skipping over values that say how many pieces are on board
for (int i = 3; i <= 12; i++)
{
//compatible with piece numbers up to 12(max)
if (Integer.parseInt(firstsplit[0])==i) {
while (i >= 1 && i <= Integer.parseInt(firstsplit[i])) {
continue;
}
System.out.println(firstsplit[i]);
}
}
}
}
}
import java.util.Scanner;
公共级风扇
{
公共静态void main(字符串[]args)
{
扫描仪s=新的扫描仪(System.in);
//首次输入
System.out.println(“输入您的第一个输入:”);
字符串first=s.nextLine();
字符串[]firstsplit=first.split(“,”);
//第二输入
System.out.println(“输入第二个输入:”);
字符串second=s.nextLine();
字符串[]secondsplit=second.split(“,”);
//第三输入
System.out.println(“输入第三个输入:”);
字符串third=s.nextLine();
字符串[]thirdsplit=third.split(“,”);
//第四输入
System.out.println(“输入第四个输入:”);
字符串第四个=s.nextLine();
String[]fourthsplit=fourth.split(“,”);
//第五输入
System.out.println(“输入第五个输入:”);
字符串fifth=s.nextLine();
字符串[]fifthsplit=fifth.split(“,”);
对于(int a=0;a而言,问题在于:
while (i >= 1 && i <= Integer.parseInt(firstsplit[i])) {
continue;
}
while(i>=1&&i)你确定while(i>=1&&i)谢谢你。我没有意识到。