forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathF.java
90 lines (88 loc) · 2.51 KB
/
F.java
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class F{
public static void main(String[] args){
int count=0;
for(int a=1;a<=9;a++){
for(int b=0;b<=9;b++){
for(int c=0;c<=9;c++){
for(int d=0;d<=9;d++){
for(int e=0;e<=9;e++){
for(int f=1;f<=9;f++){
for(int g=0;g<=9;g++){
for(int h=0;h<=9;h++){
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=1;k<=9;k++){
for(int l=0;l<=9;l++){
for(int m=0;m<=9;m++){
for(int n=0;n<=9;n++){
for(int o=0;o<=9;o++){
for(int p=0;p<=9;p++){
for(int q=0;q<=9;q++){
for(int r=0;r<=9;r++){
for(int s=0;s<=9;s++){
for(int t=0;t<=9;t++){
if((10000*a+1000*b+100*c+10*d+e)*(10000*f+1000*g+100*h+10*i+j)==1000000000*k+100000000*l+10000000*m+1000000*n*100000*o+10000*p+1000*q+100*r+10*s+t){
if(a!=b&&a!=c&&a!=d&&a!=e&&a!=f&&a!=g&&a!=h&&a!=i&&a!=j){
if(b!=c&&b!=d&&b!=e&&b!=f&&b!=g&&b!=h&&b!=i&&b!=j){
if(c!=d&&c!=e&&c!=f&&c!=g&&c!=h&&c!=i&&c!=j){
if(d!=e&&d!=f&&d!=g&&d!=h&&d!=i&&d!=j){
if(e!=f&&e!=g&&e!=h&&e!=i&&e!=j){
if(f!=g&&f!=h&&f!=i&&f!=j){
if(g!=h&&g!=i&&g!=j){
if(h!=i&&h!=j){
if(i!=j){
if(k!=l&&k!=m&&k!=n&&k!=o&&k!=p&&k!=q&&k!=r&&k!=s&&k!=t){
if(l!=m&&l!=n&&l!=o&&l!=p&&l!=q&&l!=r&&l!=s&&l!=t){
if(m!=n&&m!=o&&m!=p&&m!=q&&m!=r&&m!=s&&m!=t){
if(n!=o&&n!=p&&n!=q&&n!=r&&n!=s&&n!=t){
if(o!=p&&o!=q&&o!=r&&o!=s&&o!=t){
if(p!=q&&p!=r&&p!=s&&p!=t){
if(q!=r&&q!=s&&q!=t){
if(r!=s&&r!=t){
if(s!=t){
System.out.println(a+b+c+d+e+" ✕ "+f+g+h+i+j+" = "+k+l+m+n+o+p+q+r+s+t);
count++;
if(count==10){
break;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}