Disarium numbers: Difference between revisions
Content added Content deleted
(Added FutureBasic solution) |
|||
Line 825: | Line 825: | ||
0 1 2 3 4 5 6 7 8 9 89 135 175 518 598 1306 1676 2427 2646798 |
0 1 2 3 4 5 6 7 8 9 89 135 175 518 598 1306 1676 2427 2646798 |
||
</pre> |
</pre> |
||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
long c = 0, n = 0, t, i |
|||
CFStringRef s |
|||
while ( c < 18 ) |
|||
s = fn StringWithFormat(@"%ld",n) |
|||
t = 0 |
|||
for i = 0 to len(s) - 1 |
|||
t += intVal(mid(s,i,1))^(i+1) |
|||
next |
|||
if ( t == n ) |
|||
print n |
|||
c++ |
|||
end if |
|||
n++ |
|||
wend |
|||
HandleEvents |
|||
</syntaxhighlight> |
|||
=={{header|Go}}== |
=={{header|Go}}== |