www.ndwl.net > VB编程题目

VB编程题目

'略微有些难度Private Sub command1_click()Dim X As StringDim brrDim a As LongDim b As LongX = InputBox("请输入2个整数(以英文逗号分隔):", "交换变量", "例如:3,344", 1000, 1000)brr = Split(X, ",") If UBound(brr) > 1 ThenMsgBox "...

窗体上加一个按钮,完整代码如下: Option Explicit Private Type Record MyName As String * 1 MyAve As Single End Type Private Sub Command1_Click() Dim d(20, 5) As Integer Dim x As Integer Dim i As Integer Dim j As Integer Dim EvrA...

我能说看不清楚么? Private Sub Command1_Click()a = Val(Text1) '文本框里的值取出来b = Val(Text2) '分别存到三个变量里,做方程的系数c = Val(Text3)If a 0 Then '首先判断第一个系数不为0 的情况 dt = b ^ 2 - 4 * a * c '公式中用到的表达...

Private Sub Form_Click() Dim i As Long, A As Long A = 0 For i = 1 To 200 If i Mod 5 = 0 And i Mod 7 = 0 Then Print i A = A + i End If Next Print "以上是同时被5和7整除的数,和=" & A End Sub

Private Sub Command1_Click() If Len(Text1) >= 2 Then Text1 = Left(Text1, 2) End If End Sub Private Sub Command2_Click() Text1 = "" End Sub Private Sub Form_Load() Label1.Caption = "新字符串" Command1.Caption = "左边2个字符" Co...

Private Sub Command1_Click()Dim i As Integer, j As IntegerFor i = -4 To 4Print Spc(3 + Abs(i)); String(2 * (4 - Abs(i)) + 1, "*")NextEnd Sub

Private Sub Command1_Click() Dim H As Integer, L As Integer For i = 1 To 35 For j = 1 To 35 If 4 * i + j * 2 = 100 Then Print "兔子的数量是" & i & "只,鸡的数量是" & j & "只" End If Next j Next iEnd Sub

定义变量及数组 录入 求出平均值 循环各数组元素,条件满足

Private Sub Command1_Click() Dim n As Long n = Val(InputBox("输入", "请输入您个年龄", 12)) If n < 18 Then Print n; "少年" ElseIf n >= 18 And n < 45 Then Print n; "青年" ElseIf n >= 45 And n 59 Then Print n; "老年" Else Print n...

#include"stdio.h" #include"string.h" #define N 1000 void menu(); int password(); int dedao(); int uninque(struct STUDENT shu[],int len,int xuehao); void shuchu(struct STUDENT shu[],int len); void send(struct STUDENT shu[],int l...

网站地图

All rights reserved Powered by www.ndwl.net

copyright ©right 2010-2021。
www.ndwl.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com