public class Decitroll public static void main String args long long 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
public class Decitroll {
public static void main(String[] args)
{
long x = 9;
//long y = 1240765;
//long z = 23814895;
//long yz = y * z;
//System.out.println(yz + " " + "2483631951203");
//long a = 0;
for (long a = 0; a <= x; a++)
for (long b = 0; b <= x; b++)
for (long c = 0; c <= x; c++)
for (long d = 0; d <= x; d++)
for (long e = 0; e <= x; e++)
for (long f = 0; f <= x; f++)
//if ( ( (b * (10 ^ 4)) + (e * (10 ^ 3)) + (d * (10 ^ 2)) + 97 ) * ( (c * (10 ^ 5)) + (a * (10 ^ 4)) + (f * (10 ^ 3)) + 800 + (d * (10 ^ 1)) + d ) == ( (c * (10 ^ 9)) + (9 * (10 ^ 8)) + (6 * (10 ^ 7)) + (d * (10 ^ 6)) + (d * (10 ^ 5)) + (7 * (10 ^ 4)) + (7 * (10 ^ 3)) + (7 * (10 ^ 2)) + (a * (10 ^ 1)) + b ) )
{
/*int[] bed97 = {7, 9, d, e, b};
int[] caf8dd = {d, d, 8, f, a, c};
int[] c96dd777ab = {b, a, 7, 7, 7, d, d, 6, 9, c};
if (digits(bed97) * digits(caf8dd) == digits(c96dd777ab))
*/
long aa = Long.parseLong(b + e + d + "97");
long bb = Long.parseLong(c + a + f + "8" + d + d);
long cc = Long.parseLong(c + "96" + d + d + "777" + a + b);
if (aa * bb == cc)
System.out.println("a = " + a + "\nb = " + b + "\nc = " + c + "\nd = " + d + "\ne = " + e + "\nf = " + f);
if (aa + bb == cc)
System.out.println("a = " + a + "\nb = " + b + "\nc = " + c + "\nd = " + d + "\ne = " + e + "\nf = " + f);
//if (aa + bb == cc)
// System.out.println("a = " + a + "\nb = " + b + "\nc = " + c + "\nd = " + d + "\ne = " + e + "\nf = " + f);
}
//int[] array = {1, 2, 3};
//System.out.println(digits(array));
}
/*private static int digits(int[] array)
{
int sum = 0;
for (int i = 0; i < array.length; i++)
{
//sum *= 10 ^ i;
sum += array[i] * Math.pow(10, i);
//sum *= 10 ^ i;
//System.out.println(array[i] + " " + i + " " + (10 ^ i) + " " + sum);
}
//System.out.println(sum);
return sum;
}*/
}