This is a simple code to take input of two numbers and print the sum.This is showing right answer in Netbeans but showing run time error in spoj as well as ideone.I am not getting what is the real problem please help.
import java.util.Scanner;
class Sum {
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int a=s.nextInt();
Scanner m=new Scanner(System.in);
int b=m.nextInt();
int z=a+b;
System.out.println(z);
}
}