I am having a problem reading inputs, can anyone help me.
Each line of the input have to Integers: X e Y separated by a space.
12 1
12 3
23 4
9 3
I am using this code in java but is not working, its only reading the first line can anyone help me?
String []f;
String line;
Scanner in=new Scanner(System.in);
while((line=in.nextLine())!=null){
f=line.split(" ");
int X,Y;
X=Integer.parseInt(f[0]);
Y=Integer.parseInt(f[1]);
if(X<=40 && Y<=40)
metohod(X,Y);
line=in.nextLine();
}
}