#include<iostream>
#include<vector>
#include<iterator>
using namespace std;
int main()
{
vector<int>ar;
vector<int> :: iterator an;
int i;
for(i=1; i<=5; i++)
{
ar.push_back(i);
}
for(i=0; i<ar.size(); i++)
{
cout << ar[i] << " ";
}
cout << endl;
for(an=ar.begin(); an != ar.end();an++)
{
cout << *an << endl;
}
return 0;
}
#include<vector>
#include<iterator>
using namespace std;
int main()
{
vector<int>ar;
vector<int> :: iterator an;
int i;
for(i=1; i<=5; i++)
{
ar.push_back(i);
}
for(i=0; i<ar.size(); i++)
{
cout << ar[i] << " ";
}
cout << endl;
for(an=ar.begin(); an != ar.end();an++)
{
cout << *an << endl;
}
return 0;
}
Comments
Post a Comment