@@ -0,0 +1,1832 @@
+/** A program that finds the right decimal digit values (0 - 9) of the letters %0A *  T, O, G and D so that TOO + TOO + TOO + TOO = GOOD. The simplest technique%0A *  uses nested loops to test a unique value for each letter.%0A */%0A%0Apackage cryptarithmetic.java;%0A%0A/**%0A *%0A * @author k8port%0A */%0Apublic class CryptArithmeticJava %7B%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A    private static final int TOO = 4; // #of distinct letters%0A    private static final int DECIMAL = 10; // # of distinct decimal digits (0-9) %0A    %0A    public static void main(String%5B%5D args) %7B%0A        %0A        int T, O, G, D; // 4 letters will have integer values%0A        int solutions = 0; // number of possible solutions%0A        %0A        for (int i = 0; i %3C DECIMAL; i++) %7B%0A            T = i;%0A            for (int j = 0; j %3C DECIMAL; j++) %7B%0A                O = j;%0A                for (int k = 0; k %3C DECIMAL; k++) %7B%0A                    G = k;%0A                    for (int l = 0; l %3C DECIMAL; l++) %7B%0A                        D = l;%0A                        if ((((T+(O*2))*TOO) == (G+(O*2)+D)) &&%0A                                (T != O && T != G && T != D && O != G &&%0A                                O != D && G != D)) %7B%0A                            solutions++;%0A                            System.out.printf(%22Value of %5C'T%5C' is %25d. %22, T);%0A                            System.out.printf(%22Value of %5C'O%5C' is %25d. %22, O);%0A                            System.out.printf(%22Value of %5C'G%5C' is %25d. %22, G);%0A                            System.out.printf(%22Value of %5C'D%5C' is %25d.%25n%22, D);%0A                        %7D // end of if %0A                    %7D // end of for loop l%0A                %7D // end of for loop k%0A             %7D // end of for loop j%0A        %7D // end of for loop i%0A        System.out.printf(%22There are %25d different solutions.%25n%22, solutions);%0A    %7D%0A    %0A%7D%0A

Create CryptArithmeticJava.java