/* Sherlock Holmes went on an adventure in a castle and saw a strange formula on the door: ABCDE *? = Edcba he said to Watson: "ABCDE should represent different numbers. A question mark also represents a number !" WATSON: "I guess so !" As a result, the two were silenced for a long time and still did not come up with the appropriate results. Please take advantage of your computer to find the answer to the attack. Write the number represented by ABCDE. */# Include <iostream> using namespace STD; void main () {int K, T1, T; // What is T1? , K is ABCDE, t is edcba // edcba is bigger than ABCDE, and at least 2 times // the minimum value of ABCDE is 10234 for (k = 10234; k <50000; k ++) {// K = 10234 bool flag [10] = {0}; t = K; T1 = 0; while (t) {If (flag [T % 10]) // there are 10 false values in the flag, T % 10, remainder, flag [T % 10] Break; flag [T % 10] = true; // if the previous step is false, if there is no break, set flag [T % 10] to true to exclude the occurrence of identical numbers T1 = T1 * 10 + T % 10; // T1 stands for edcba t/= 10;} // traverses all numbers that do not have the same number if (t = 0 & T1 % K = 0) {// T = 0, because ABCDE In the subscript of flag , So t = 0; while T1 % K = 0, that is, T1/k = ?,? Is an integer cout <k <"*" <t1/k <"=" <t1 <Endl ;}}}