#9033: [JAVA]求助! 用IDE主控台可以跑,傳上來一直RE、WA


highcollege90027 (冰人雪糕)


程式碼:

import java.util.Scanner;


public class a244_新手訓練_for_if {


public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int m;

int a, b, c;

int sum;

while(input.hasNext()) {

m = input.nextInt();

for(int i = 0; i < m; i++) {

a = input.nextInt();

b = input.nextInt();

c = input.nextInt();

if(a == 1)

System.out.println("" + (b + c));

else if(a == 2)

System.out.println("" + (b - c));

else if(a == 3)

System.out.println("" + (b * c));

else if(a == 4)

System.out.println("" + (b / c));

}

}

}

}

 

#32914: Re: [JAVA]求助! 用IDE主控台可以跑,傳上來一直RE、WA


MacroHaaaaa (CodeLoser)


應該用Long才可以吧