vector<int>vec;// some code here
for(inti=0;i<vec.size()-1;i++){cout<<vec[i]<<' ';}
原本思路
只打印$vec$的前$|vec| - 1$个元素,就用这个挺好!
显示出的问题
Segmentation Fault
11/0/11
解读
1
2
C:/blahblah/blahblahblah.cpp:2022:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
for (int i = 0; i < vec.size(); i ++ ) {