奇偶输出的问题
v2输出v1的奇数,v3输出偶数,不知哪里不对,没报错,但调试不过TATint main()
{
std::list<int> v1 = { 1,2,3,4,5,6,7,8 };
std::list<int>::iterator it;
it = v1.begin();
++it;
std::deque<int> v2, v3;
for (auto i = v1.begin(); i != v1.end(); ++i, ++i)
v2.push_back(*i);
auto i = v1.begin();
for (auto i = it; i != v1.begin(); ++i, ++i)
v3.push_back(*i);
for (auto i : v2)std::cout << i;
for (auto i : v3)std::cout << i;
}