Home > Software engineering >  VBS write a program: input a string of code, meet? Stop input. Then calculate the number of input up
VBS write a program: input a string of code, meet? Stop input. Then calculate the number of input up

Time:09-22

 Dim, sum1, sum2, sum3, d 
Sumone=0
Sumtwo=0
Sumthree=0
D=""
While d<& gt;" Chen, "here," Chen "instead of"?" , runtime, input? Would be an error, and to Chen, Chen run input can
D=inputbox (" please input a string of characters: ")
If d>="a" and d<="z" Then
Sumone=sumone + 1
Elseif d>="A" and d<="Z" Then
Sumtwo=sumtwo + 1
Elseif d>="0" and d>="9" Then 'runtime input Numbers here, the number of didn't add to sumthree inside, but added the sumone, why
Sumthree=sumthree + 1

End the If
Wend
Print "number for output lowercase letters" & amp; Sumone
Print "output number for capital letters" & amp; Sumtwo
Print "output digital number for" & amp; Sumthree

CodePudding user response:

Elseif d>="0" and d & gt;= "9" Then

Apparently "logical operators" write wrong, should be used & lt;=


As for the "end", arguably, you can define any logo,
I try to use the "?" If really can't...

CodePudding user response:

Put this code written. VBS file, fixed "errors",
Running test, use "?" As the end of the logo is no problem,


The original poster, please check your code carefully input if there is a problem, paying special attention to the whole Angle, half Angle difference,
  • Related