import java.util.*;
public class a005
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNext())
{
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int d=sc.nextInt();
int e;
if ((d-c)==(c-b) && (c-b)==(b-a))
{
e=d+(d-c);
System.out.println(a+" "+b+" "+c+" "+d+" "+e);
}
else if ((double)(d/c)==(double)(c/b) && (double)(c/b)==(double)(b/a))
{
e=d*(d/c);
System.out.println(a+" "+b+" "+c+" "+d+" "+e);
}
else
{
}
}
}
}
回報的問題
執行時發生錯誤(code:1)!!
Exception in thread "main" java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:838)
at java.util.Scanner.next(Scanner.java:1461)
at java.util.Scanner.nextInt(Scanner.java:2091)
at java.util.Scanner.nextInt(Scanner.java:2050)
at code_890599.main(code_890599.java:11)
或者是各位高手有看到任何其他邏輯或語法上的問題
還煩請多指教