VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/23 00:31:25
VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?
请用for语句
请用for语句
Option Explicit
Private Sub Command1_Click()
Dim i As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim n As Integer
n = 0
For i = 1 To 200
a = i \ 100
b = i \ 10 Mod 10
c = i Mod 10
If a = 3 Then
n = n + 1
End If
If b = 3 Then
n = n + 1
End If
If c = 3 Then
n = n + 1
End If
Next i
Print n
End Su
Private Sub Command1_Click()
Dim i As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim n As Integer
n = 0
For i = 1 To 200
a = i \ 100
b = i \ 10 Mod 10
c = i Mod 10
If a = 3 Then
n = n + 1
End If
If b = 3 Then
n = n + 1
End If
If c = 3 Then
n = n + 1
End If
Next i
Print n
End Su
VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?
有人顺序写数1,2,3,...,9,10,11,...一直写到1000,一共写了多少个数字?其中写了多少个0?
从1写到100,数字0一共写了多少个?数字1一共写了多少个?数字2、3、4、5、6、7、8、9一共写了多少个?
按顺序写数1,2,3,..9,10,11,..,100,..一直写到1000,一共写了多少数字?
计算机VF.用循环结构,FOR,INPUT等语句或函数求从2到1000的素数及素数的个数.写程序源码
VB中For循环语句问题
VB 2个FOR循环语句求解答
VB 利用for each...next循环语句,求 1+2+3+...+100的值 .
VB FOR 循环语句
小明从1写到100,他一共写了多少个数字0?
VB程序中关于循环语句:“FOR”的使用
VB循环语句求s=1+3+5+……+2n-1的值