NZEC Error on ARITH2
//package spoj;
import java.util.Scanner;
/*public */class ARITH2 {
public static void main(String[] args) {
long casos = 0;
String ecuacion = "";
Scanner s = new Scanner(System.in);
casos = s.nextInt();
while(casos--!=-1){
ecuacion = s.nextLine();
if(!ecuacion.isEmpty()){
String partes[] = ecuacion.split(" * ");
long total = Long.parseLong(partes[0]);
for(long i = 0; i < partes.length; ++i){
if(partes[(int)i].equalsIgnoreCase("*")){
total *= Long.parseLong(partes[(int)i+1]);
}
if(partes[(int)i].equalsIgnoreCase("+")){
total += Long.parseLong(partes[(int)i+1]);
}
if(partes[(int)i].equalsIgnoreCase("/")){
total /= (int)Long.parseLong(partes[(int)i+1]);
}
}
System.out.println(total);
}
}
}
}
on my computer runs perfectly. but when I submit it says error in spoj NZEC me ..! which means that error