read str into int array, note when input is 0