My program finds all the 4-digit vampire numbers.

There should be a total of only 7 numbers, but i'am getting 14.

How to remove the duplicates?

Code:

#include"stdafx.h"
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
bool bothTrailingZeros(const int& x, const int& y)
{
return ((x % 10) == 0) && ((y % 10) == 0);
}
vector<int> digits(int n)
{
vector<int> ret;
while (n > 0)
{
ret.push_back(n % 10);
n /= 10;
}
return ret;
}
int main()
{
int v;
vector<int> digits_v, digits_i, digits_j;
//fangs for 4-digit vampire numbers must have 4/2 == 2 digits
for (int i = 10; i < 100; ++i)
{
for (int j = 10; j < 100; ++j)
{
if ((i*j)>9999)
break;
if (bothTrailingZeros(i, j))
continue;
v = i*j;
digits_v = digits(v);
digits_i = digits(i);
digits_j = digits(j);
for (const int& x : digits_j) //digits of j are put together with digits of i
digits_i.push_back(x);
sort(digits_v.begin(), digits_v.end());
sort(digits_i.begin(), digits_i.end());
if (digits_i == digits_v)
{
cout << v << " = " << i << " x " << j << endl;
}
}
}
}