編譯錯誤怎麼改才對?
package practice; import java.util.*; public class B1 { public static void main(String[] args) { int a,b,c,d; Scanner sc=new Scanner(System.in); while(sc.hasNext()) { a=sc.nextInt(); b=sc.nextInt(); c=sc.nextInt(); d=sc.nextInt(); if((d-c)==(c-b)&&(c-b)==(b-a)) { System.out.println(a+" "+b+" "+c+" "+d+" "+(d+d-c)); } else if((d/c)==(c/b)&&(c/b)==(b/a)) { System.out.println(a+" "+b+" "+c+" "+d+" "+(d*d/c)); } } } }
編譯錯誤怎麼改才對?
package practice; import java.util.*; public class B1 { public static void main(String[] args) { int a,b,c,d; Scanner sc=new Scanner(System.in); while(sc.hasNext()) { a=sc.nextInt(); b=sc.nextInt(); c=sc.nextInt(); d=sc.nextInt(); if((d-c)==(c-b)&&(c-b)==(b-a)) { System.out.println(a+" "+b+" "+c+" "+d+" "+(d+d-c)); } else if((d/c)==(c/b)&&(c/b)==(b/a)) { System.out.println(a+" "+b+" "+c+" "+d+" "+(d*d/c)); } } } }
少了t。