-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual Basic程序设计1-10 | 罗中算法练习 #2
Comments
关于github账号注册,同学们可以百度搜索:github注册 |
题目一的另一种解法倪 |
等你在评论里写出来,哈哈 |
这。。。我写写看,有点忘了 |
Private Sub Command1_Click() End Sub |
排序代码没错,可是你有两个小问题:
Label1.Caption = Str(a1) + "" + Str(a2) + "" + Str(a3) a1改成a(1),然后你加了一个""字符串,不是相当于没加吗. |
那你答案的输出语句的“”“”也可以去掉哩 |
恩,是的,可是我写出来是一种提示作用,有些学生可能不清楚str用完后会自动在前面加一个空格 |
第二题的sum用integer会不会溢出呀 |
你说的对,我只限制了单个数,两数加起来就超过integer范围了,我稍后修改 |
很不错的思路,先将3个数字从小到大排序,然后将最大的两个相加。 Dim a , b , c as Integer
Dim s as Integer
a=Val (text1.text)
b=Val (text2.text)
c=Val (text3.text)
If a>b then t=a:a=b:b=t
If a>c then t=a:a=c:c=t
If b>c then t=b:b=c:c=t
s=b+c
Lable1.caption= Str(s) |
你好,黄老师 |
https://alturet.github.io/lifenote/2019/01/22/VisualBasica/
Visual Basic程序设计1-10题目1:输入三个整数x,y,z,请把这三个数由小到大输出。样例输入(3个Text文本框输入):
The text was updated successfully, but these errors were encountered: