How to resolve the algorithm Super-d numbers step by step in the Amazing Hopper programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Super-d numbers step by step in the Amazing Hopper programming language
Table of Contents
Problem Statement
A super-d number is a positive, decimal (base ten) integer n such that d × nd has at least d consecutive digits d where For instance, 753 is a super-3 number because 3 × 7533 = 1280873331.
Super-d numbers are also shown on MathWorld™ as super-d or super-d.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Super-d numbers step by step in the Amazing Hopper programming language
Source code in the amazing programming language
#include
algoritmo
decimales '0'
d=2
ir a sub mientras ( #(d<=8), encontrar súperd )
terminar
subrutinas
sub( encontrar súperd )
imprimir("First 10 super-",d," numbers:\n")
count=0, j = 3.0, target=""
#(target = replicate( chr( 48 + d), d ))
iterar mientras ' #(count < 10) '
cuando( #(occurs(target, string( (j^d) * d ))) ){
si ( #( find(target,string( (j^d) * d ))<=16-d+1 ) )
++count, #((j^d) * d ),";"#(int(j)),"\n", imprimir
sino
imprimir("Error by limited floating-point\n")
fin si
}
++j
reiterar
saltar
++d
retornar
You may also check:How to resolve the algorithm Copy stdin to stdout step by step in the Scala programming language
You may also check:How to resolve the algorithm Set step by step in the Go programming language
You may also check:How to resolve the algorithm Filter step by step in the Ring programming language
You may also check:How to resolve the algorithm LZW compression step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Bitmap step by step in the J programming language