ex17: fix the bug of the array length