i don't get what the problem is...?
if you want to read some numbers (endless loop) from the input, you can do sth like this:
//doing something with number
for example you have some numbers in input (you don't know how many) and the output is the sum of them
then you write sth like this:
so... example with numbers:
input : 2 6 33 67 12 54
I don't get it why you need to write string to values array or whatever...
if you want to write values into integer array, (let's say there won't be more than 100 values) then you can just:
int x, array;