#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a, b, c, d, e, f, g, h;
int num1;
for (int i = 10000; i <= 99999; i++)
{
a = i / 10000;
b = i % 10000;
c = i / 1000;
d = i % 1000;
e = i / 100;
f = i % 100;
g = i / 10;
h = i % 10;
num1 = (a * b) + (c * d) + (e * f) + (g * h);
if (i == num1)
{
cout << i << " ";
}
}
return 0;
}
#include <cmath>
using namespace std;
int main()
{
int a, b, c, d, e, f, g, h;
int num1;
for (int i = 10000; i <= 99999; i++)
{
a = i / 10000;
b = i % 10000;
c = i / 1000;
d = i % 1000;
e = i / 100;
f = i % 100;
g = i / 10;
h = i % 10;
num1 = (a * b) + (c * d) + (e * f) + (g * h);
if (i == num1)
{
cout << i << " ";
}
}
return 0;
}