In C++ if I wish to read input till the EOF I can do it in the following manner
while(scanf(\"%d\",&n)) { A[i]=n; i++; }
I can
The only thing that really works for me (you don't even have to create a file)
Scanner read = new Scanner(System.in); String cadena; boolean cond = true; int i =0; while (cond){ cadena = read.nextLine(); if(cadena.isEmpty()) cond = false; }