On Nov 19, 4:09 am, "asdf" <likemurs...@gmail.comwrote:
It is best to show me some examples.
Thanks a lot.
#include <iostream>
#include <vector>
using namespace std;
vector<pair<int, int squares;
int main()
{
for (int i = 0;i < 5;++i)
{
squares.push_back(make_pair(i, i*i));
}
for (vector<pair<int, int::const_iterator pos =
squares.begin();pos != squares.end();++pos)
{
cout << pos->first << "^2 = " << pos->second << endl;
}
}