case 2: int n;
int fact;
fact = 1;
System.out.println("What is your number");
n = scan.nextInt();
for (i >= n; i++;)
{
fact = fact*i;
}
System.out.println("The factorial of" + n + fact);
System.exit(0);
情况2不在一条较大的链中,它返回一条错误消息,指出“ i> = n”不是语句。
答案 0 :(得分:0)
第一个语句应该是for循环中的初始化语句。阅读 - https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html