1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> #include <cstdlib> #include <vector> using namespace std; int main() { vector<int> vec = { 1, 3, 5 }; for( vector<int>::iterator it = vec.begin(); it != vec.end(); ++it ) { cout << *it << endl; } for( int index = 0; index != vec.size(); ++index ) cout << vec[ index ] << endl; system("pause"); } |
Direct link: https://paste.plurk.com/show/293724