猪拉丁计划 [英] Pig latin program
问题描述
我的猪拉丁程序看起来像这样
Dim strInput,str1stCharacter,strOutput,stranswer As String,intStringLength As Integer
strInput = txtenglish.Text
str1stCharacter = Microsoft.VisualBasic.Left(strInput,1)
如果str1stCharacter =" A"或str1stCharacter =" E"或str1stCharacter =" I"或str1stCharacter =" O"或str1stCharacter =" U"然后
strOutput = strInput& WAY
Else
stranswer = txtanswer.Text
intStringLength = Len(strInput) - 1
strOutput = Microsoft.VisualBasic.Right(strInput,intStringLength)& str1stCharacter& WAY
stranswer = strOutput
i想知道为什么它不会在第二个文本输出框(stranswer)中显示结果
谢谢
哦VB,我多么不喜欢你......
无论如何,看起来你只设置输出的东西,如果它不是以元音开头的?
展开 | 选择 | 换行 | 行号
哦VB,我不喜欢你....
无论如何,看起来你只设置输出的东西,如果它不是用元音开始的吗?
< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号
你可以通过在那里使用case语句减少你的输入...你可能不会非常不喜欢VB:P
我不喜欢VB,原因很简单,其中一个原因就是整个VB就是一团糟。
i got my pig latin program which looks like this
Dim strInput, str1stCharacter, strOutput, stranswer As String, intStringLength As Integer
strInput = txtenglish.Text
str1stCharacter = Microsoft.VisualBasic.Left(strInput, 1)
If str1stCharacter = "A" Or str1stCharacter = "E" Or str1stCharacter = "I" Or str1stCharacter = "O" Or str1stCharacter = "U" Then
strOutput = strInput & "WAY"
Else
stranswer = txtanswer.Text
intStringLength = Len(strInput) - 1
strOutput = Microsoft.VisualBasic.Right(strInput, intStringLength) & str1stCharacter & "WAY"
stranswer = strOutput
i was wondering why it won''t show the results in the 2nd text output box(stranswer)
thank you解决方案Oh VB, how I dislike you....
Anyways, it looks like you only set the output stuff if it doesn''t start with a vowel?
Expand|Select|Wrap|Line Numbers
Oh VB, how I dislike you....
Anyways, it looks like you only set the output stuff if it doesn''t start with a vowel?
Expand|Select|Wrap|Line Numbers
You could''ve cut down your typing by using a case statement there...you probably wouldn''t dislike VB so much :PI dislike VB for a whole mess of reasons, one of which is that VB on a whole, is a mess.
这篇关于猪拉丁计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆