Home > Software engineering >  VB, recursive method
VB, recursive method

Time:03-03

1. VB recursive method two greatest common divisor of natural number
2. Reverse output string

CodePudding user response:

For homework, and you're welcome,
Subject to a patch answers, such as recommended homework help,

CodePudding user response:

1. VB recursive method two greatest common divisor of natural number
 
A=inputbox (" input the first natural number ")
B=inputbox (" enter the second natural number ")
Msgbox zuidagongyueshu (a, b)

The Function zuidagongyueshu (ByVal a, ByVal b)
T=a Mod b
If t=0 Then
Zuidagongyueshu=b
The Else
Zuidagongyueshu=zuidagongyueshu (b, t)
End the If
End the Function

Download address:
Link: https://pan.baidu.com/s/1GbRGhQJL_3fL4O_CGq34tg
The extracted code: cubu

2. The reverse output string
 
S=inputbox (" please input the original string: ")
For I=Len (s) To Step 1-1
R=r & amp; Mid (s, I, 1)
Next
Msgbox r

Download address:
Link: https://pan.baidu.com/s/1xosG09XzTityXHyfOD65Gw
The extracted code: sc-s191

CodePudding user response:

I'm sorry, next time will do that, and homework help is not very accurate, thank you

CodePudding user response:

Thank you, saved our bedroom, thank you very much

CodePudding user response:

reference 4 floor qq_44815320 response:
thank you ah, save our dormitory, thank you very much

Give you a recursive flip the string

Function RevStr (ByVal s As String) As String
If Len (s) & lt;=1 Then
RevStr=s
The Exit Function
End the If
RevStr (s, 1)=Right & amp; RevStr (Left (s, Len (s) - 1))
End the Function