<title>2015 Blue Bridge Cup: 3. Three lamb offering Rui</title> 2015 Blue Bridge Cup: 3. Three lamb offering Rui
Auspicious, Sheng Hui + three sheep------------three sheep Sheng Bling
1234+ 5672------56328
==>
9567+ 1085 10652
Compare rotten realization, recursive will not write, later see big God's Bar, small white only will violence ...
int Main(void) {int a[10] = {0}; for(A[1] = 1; a[1] <= 9; a[1]++) { for(a[2] = 0; a[2] <= 9; a[2]++) { for(a[3] = 0; a[3] <= 9; a[3]++) { for(a[4] = 0; a[4] <= 9; a[4]++) { for(A[5] = 1; a[5] <= 9; a[5]++) { for(a[6] = 0; a[6] <= 9; a[6]++) { for(a[7] = 0; a[7] <= 9; a[7]++) { for(A[8] = 0; a[8] <= 9; a[8]++) {int OK= 1; for(int I= 1; I <= 8; i++) { for(int J= 1; J <= 8; J + +) {if(i = = j) {Continue; }if(A[i] = = A[j]) {OK = 0; Break; } } }if(OK) {int NUM1= A[1]*1000+a[2]*100+a[3]*10+a[4];int num2= A[5]*1000+a[6]*100+a[7]*10+a[2];int num3= A[5]*10000+a[6]*1000+a[3]*100+a[2]*10+a[8];if(num1 + num2 = = num3) {printf ("%d\n", NUM1); printf"+%d\n", num2); printf"%d\n", num3); } } } } } } } } } }return0;}
2015 Blue Bridge Cup: 3. Three lamb offering Rui