原因 数组越界 参考-Segmentation Fault 错误原因总结 解决 数组初始化长度时 C++用 vector<int> v(n); Java用 int[] v=new int[n]; 注意 k<n , 不然访问 v[k] 会越界