Code:
cout<<"no of edges";

cin>>numof nodes;
cout<<"enter the edge and its wight";

for(i=0;i<numofedges;i++)
{
cin>>v1[i]>>v2[i];

cin>>e[v1[i]+v2[i]+v1[i]*v2[i]];
}
i used this e[v1[i]+v2[i]+v1[i]*v2[i]];
because i need to know that this "e" ie weight belongs to this v1 and v2...
but this is giving me prob as the calculation gets lengthier...
just somefunc(v1,v2) shud return a unique index to determine e.
any other suggestion

e[something] ...something should be a value calculated for v1 and v2