VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/07/14 07:58:41
VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?
请用for语句
请用for语句
![VB程序 for循环语句问题 从1,2,3,……,一直写到200,一共写了多少个数码3?](/uploads/image/z/6816702-30-2.jpg?t=VB%E7%A8%8B%E5%BA%8F+for%E5%BE%AA%E7%8E%AF%E8%AF%AD%E5%8F%A5%E9%97%AE%E9%A2%98+%E4%BB%8E1%2C2%2C3%2C%E2%80%A6%E2%80%A6%2C%E4%B8%80%E7%9B%B4%E5%86%99%E5%88%B0200%2C%E4%B8%80%E5%85%B1%E5%86%99%E4%BA%86%E5%A4%9A%E5%B0%91%E4%B8%AA%E6%95%B0%E7%A0%813%3F)
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的值