''dfbf / bgak = b
'' - + +
''hhfh + ecc = hkfh
''kjkj - ebak = hkfe
for a = 0 to 9
for b = 0 to 9
for c = 0 to 9
for d = 0 to 9
for e = 0 to 9
for f = 0 to 9
for g = 0 to 9
for h = 0 to 9
for j = 0 to 9
for k = 0 to 9
q$ = str$( a );b;c;d;e;f;g;h;j;k
if ispermutation( q$ ) then
print q$
a$ = str4$( d , g , b , f )
b$ = str4$( b , g , a , k )
c$ = str4$( 0 , 0 , 0 , b )
d$ = str4$( h , h , f , h )
e$ = str4$( 0 , e , c , c )
f$ = str4$( h , k , f , h )
g$ = str4$( k , j , k , j )
h$ = str4$( e , b , a , k )
j$ = str4$( h , k , f , e )
if val( a$ ) / val( b$ ) = val( c$ ) then
if val( d$ ) + val( e$ ) = val( f$ ) then
if val( g$ ) - val( h$ ) = val( j$ ) then
if val( a$ ) - val( d$ ) = val( g$ ) then
if val( b$ ) + val( e$ ) = val( h$ ) then
if val( c$ ) + val( f$ ) = val( j$ ) then
print a$ + " / " + b$ + " = " + c$
print " - + +"
print d$ + " + " + e$ + " = " + f$
print g$ + " - " + h$ + " = " + j$
end
end if
end if
end if
end if
end if
end if
end if
next k
next j
next h
next g
next f
next e
next d
next c
next b
next a
end
function str4$( x , y , z , w )
str4$ = str$( x ) ; y ; z ; w
end function
function ispermutation( q$ )
uit = 1
for i = 0 to 9
if instr( q$ , str$( i ) ) = 0 then
uit = 0
end if
next i
ispermutation = uit
end function
'5928 / 2964 = 0002
' - + +
'1181 + 0300 = 1481
'4747 - 3264 = 1483
''dfbf / bgak = b
'' - + +
''hhfh + ecc = hkfh
''kjkj - ebak = hkfe
for a = 0 to 9
for b = 1 to 3 '0 to 9
for c = 0 to 0 '0 to 9
for d = 0 to 9
'for e = 2 to 4 '0 to 9
e=b+1
for f = 0 to 9
for g = 0 to 9
for h = 1 to 1 '0 to 9
for j = 0 to 9
for k = 0 to 9
scan
q$ = str$( a );b;c;d;e;f;g;h;j;k
if ispermutation( q$ ) then
print q$
a$ = str4$( d , g , b , f )
b$ = str4$( b , g , a , k )
c$ = str4$( 0 , 0 , 0 , b )
d$ = str4$( h , h , f , h )
e$ = str4$( 0 , e , c , c )
f$ = str4$( h , k , f , h )
g$ = str4$( k , j , k , j )
h$ = str4$( e , b , a , k )
j$ = str4$( h , k , f , e )
if val( a$ ) / val( b$ ) = val( c$ ) then
if val( d$ ) + val( e$ ) = val( f$ ) then
if val( g$ ) - val( h$ ) = val( j$ ) then
if val( a$ ) - val( d$ ) = val( g$ ) then
if val( b$ ) + val( e$ ) = val( h$ ) then
if val( c$ ) + val( f$ ) = val( j$ ) then
print a$ + " / " + b$ + " = " + c$
print " - + +"
print d$ + " + " + e$ + " = " + f$
print g$ + " - " + h$ + " = " + j$
end
end if
end if
end if
end if
end if
end if
end if
next k
next j
next h
next g
next f
'next e
next d
next c
next b
next a
end
function str4$( x , y , z , w )
str4$ = str$( x ) ; y ; z ; w
end function
function ispermutation( q$ )
uit = 1
for i = 0 to 9
if instr( q$ , str$( i ) ) = 0 then
uit = 0
end if
next i
ispermutation = uit
end function