This is the c++ code.
while(scanf("%d%d", &m, &n) != -1) {
//some logic
}
how to convert this code into java?.
This is the c++ code.
while(scanf("%d%d", &m, &n) != -1) {
//some logic
}
how to convert this code into java?.
While(console.readLine() != - 1)
{
Some logic
}
try
Scanner scanner=new Scanner(System.in);
int m,n;
while( (m =scanner.nextInt()) != -1 && (n=scanner.nextInt()) != -1) {
//some logic
System.out.println(m +"\t"+n);
}