I don't know what's wrong with the follwing code, it should read numbers and put their value with the position together in a vector of pairs and then sort them and print out the positions. I removed the part with sort - i thought the problem was there, but i received an error on compilation again.
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int main(void)
{
unsigned int n,d,a[65],b[65],s,i,j,t,us=0;
pair<unsigned int,unsigned int> temp;
vector< pair<unsigned int,unsigned int> > v;
cin >> n;
for(i=0;i<n;i++)
{
cin >> t;
temp(t, i+1);
v.push_back(temp);
}
cin >> d;
for(i=0;i<d;i++) cin >> a[i] >> b[i];
for(i=0;i<v.size();i++)
{
cout << v[i].first << " -- " << v[i].second << endl;
}
return 0;
}
Please tell me where is the problem. Thanks.