成就砖头

文章
5
资源
0
加入时间
3年0月28天

C++中for循环的两种用法用法1用法2

C++中for循环的两种用法用法1下标方式迭代器方式用法2用法1下标方式以打印给定数组为例,代码如下:for (auto it = ans.begin(); it < ans.end(); ++it) { cout << *it <<endl; }迭代器方式以打印给定数组为例,代码如下:for (vector<int>::iterator it = nums.begin(); it &a