Advertisement
Gustavo_Inzunza

busqueda

Oct 22nd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. vector <double> v1,v2;
  2. //aca los igualas a los valores a comparar
  3. sort(v1.begin(),v1.end());
  4. sort(v2.begin(),v2.end());
  5. int flag=0;
  6. for(int i=0;i<v1.size();i++)
  7. {
  8.     for(int j=0;<v2.size();j++)
  9.         if(v1[i]==v2[j])
  10.             flag++;
  11.         else
  12.         {
  13.             cout<<"son distintos"<<endl;
  14.             i=v1.size();
  15.             break;
  16.         }
  17. }
  18. if(flag==v1.size())
  19.     cout<<"son iguales<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement