SEND + MORE = MONEY: Difference between revisions

Content added Content deleted
m (→‎{{header|Ring}}: replaced duplicate header)
(SEND + MORE = MONEY in PureBasic)
Line 91: Line 91:
next e
next e
next s</syntaxhighlight>
next s</syntaxhighlight>
{{out}}
<pre>Same as FreeBASIC entry.</pre>

==={{header|PureBasic}}===
<syntaxhighlight lang="PureBasic">OpenConsole()
m.i = 1
For s.i = 8 To 9
For e.i = 0 To 9
If e <> m And e <> s
For n.i = 0 To 9
If n <> m And n <> s And n <> e
For d.i = 0 To 9
If d <> m And d <> s And d <> e And d <> n
For o.i = 0 To 9
If o <> m And o <> s And o <> e And o <> n And o <> d
For r.i = 0 To 9
If r <> m And r <> s And r <> e And r <> n And r <> d And r <> o
For y.i = 0 To 9
If y <> m And y <> s And y <> e And y <> n And y <> d And y <> o
If ((1000*(s+m))+(100*(e+o))+(10*(n+r))+(d+e)) = ((10000*m)+(1000*o)+(100*n)+(10*e)+y)
PrintN(Str(s)+Str(e)+Str(n)+Str(d)+" + "+Str(m)+Str(o)+Str(r)+Str(e)+" = "+Str(m)+Str(o)+Str(n)+Str(e)+Str(y))
EndIf
EndIf
Next y
EndIf
Next r
EndIf
Next o
EndIf
Next d
EndIf
Next n
EndIf
Next e
Next s
CloseConsole()</syntaxhighlight>
{{out}}
{{out}}
<pre>Same as FreeBASIC entry.</pre>
<pre>Same as FreeBASIC entry.</pre>