Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Digital-root/VBScript/digital-root.vb
Normal file
15
Task/Digital-root/VBScript/digital-root.vb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Function digital_root(n)
|
||||
ap = 0
|
||||
Do Until Len(n) = 1
|
||||
x = 0
|
||||
For i = 1 To Len(n)
|
||||
x = x + CInt(Mid(n,i,1))
|
||||
Next
|
||||
n = x
|
||||
ap = ap + 1
|
||||
Loop
|
||||
digital_root = "Additive Persistence = " & ap & vbCrLf &_
|
||||
"Digital Root = " & n & vbCrLf
|
||||
End Function
|
||||
|
||||
WScript.StdOut.Write digital_root(WScript.Arguments(0))
|
||||
Loading…
Add table
Add a link
Reference in a new issue