100分(回复满意加50)问几道VB的题目。能答的就答吧。是我考试的题库。希望不要出错~~还有要写清题号哦~
1.有一个三位数满足下列条件:(1)此三位数的三位数字各不相同;(2)此三位数等于它的各位数字的立方和。试求所有这样的三位数之和。2.[100,666]范围内同时满足以下...
1.有一个三位数满足下列条件: (1)此三位数的三位数字各不相同; (2)此三位数等于它的各位数字的立方和。试求所有这样的三位数之和。
2.[100,666]范围内同时满足以下两个条件的十进制数. ⑴其个位数字与十位数字之和除以10所得的余数是百位数字;⑵该数是素数; 求有多少个这样的数?
3.编程计算10-500的偶数和。
4.编写程序,求[200,1000]既能被3整除又能被5整除的数的和。
5.编写程序,求共有几组i、j、k符合算式ijk+kji=1333,其中i、j、k是0~9之间的一位整数。
6.编写程序,求三位数的奇数中,所有各位数字之和是15的倍数的数的和。
7.编写程序,统计100到650之间能同时被3和7整除的数的个数。
8.斐波那契数列的前二项是1,1,以后每一项都是前面两项之和。求100000以内有多少个斐波那契数?
9.斐波那契数列的前二项是1,1,以后每一项都是前面两项之和。求此数列的第35项数是多少?
10.回文数是指正读和反读都一样的正整数。例如3773是回文数。求出[2000,9999]以内的所有回文数的个数。
11.计算前N个自然数之和,求和数不大于2000的最大和数。 展开
2.[100,666]范围内同时满足以下两个条件的十进制数. ⑴其个位数字与十位数字之和除以10所得的余数是百位数字;⑵该数是素数; 求有多少个这样的数?
3.编程计算10-500的偶数和。
4.编写程序,求[200,1000]既能被3整除又能被5整除的数的和。
5.编写程序,求共有几组i、j、k符合算式ijk+kji=1333,其中i、j、k是0~9之间的一位整数。
6.编写程序,求三位数的奇数中,所有各位数字之和是15的倍数的数的和。
7.编写程序,统计100到650之间能同时被3和7整除的数的个数。
8.斐波那契数列的前二项是1,1,以后每一项都是前面两项之和。求100000以内有多少个斐波那契数?
9.斐波那契数列的前二项是1,1,以后每一项都是前面两项之和。求此数列的第35项数是多少?
10.回文数是指正读和反读都一样的正整数。例如3773是回文数。求出[2000,9999]以内的所有回文数的个数。
11.计算前N个自然数之和,求和数不大于2000的最大和数。 展开
3个回答
展开全部
1.1301
Private Sub Command1_Click()
s = 0
For i = 100 To 999
A = i \ 100
B = i \ 10 Mod 10
c = i Mod 10
If A <> B And B <> c And c <> A And i = A ^ 3 + B ^ 3 + c ^ 3 Then
s = s + i
End If
Next i
Print s
End Sub
2.12
Private Sub Command1_Click()
Dim f As Boolean
s = 0
For i = 100 To 666
A = i \ 100
B = i \ 10 Mod 10
c = i Mod 10
If (B + c) Mod 10 = A Then
f = True
End If
For x = 2 To i - 1
If i Mod x = 0 Then
f = False
Exit For
End If
Next x
If f Then
s = s + 1
End If
Next i
Print s
End Sub
3.62730
Private Sub Command1_Click()
s = 0
For i = 10 To 500
If i Mod 2 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
4.31800
Private Sub Command1_Click()
s = 0
For i = 200 To 1000
If i Mod 3 = 0 And i Mod 5 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
5.6
Private Sub Command1_Click()
n = 0
For i = 0 To 9
For j = o To 9
For k = o To 9
If (i * 100 + j * 10 + k) + (k * 100 + j * 10 + i) = 1333 Then
n = n + 1
End If
Next k
Next j
Next i
Print n
End Sub
6.19731
Private Sub Command1_Click()
s = 0
For i = 101 To 999 Step 2
a = i \ 100
b = i \ 10 Mod 10
c = i Mod 10
If (a + b + c) Mod 15 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
7.26
Private Sub Command1_Click()
n = 0
For i = 100 To 650
If i Mod 3 = 0 And i Mod 7 = 0 Then
n = n + 1
End If
Next i
Print n
End Sub
8.25
Private Sub Command1_Click()
n = 2
Dim a(30) As Long
Dim i As Integer
a(1) = 1: a(2) = 1
For i = 3 To 30
a(i) = a(i - 1) + a(i - 2)
If a(i) < 100000 Then
n = n + 1
End If
Next i
Print n
End Sub
9.9227465
Private Sub Command1_Click()
Dim a(35) As Long
Dim i As Integer
a(1) = 1: a(2) = 1
For i = 3 To 35
a(i) = a(i - 1) + a(i - 2)
Next i
Print a(35)
End Sub
10.80
Private Sub Command1_Click()
n = 0
For i = 2000 To 9999
a = i \ 1000
b = i \ 100 Mod 10
c = i \ 10 Mod 10
d = i Mod 10
If a = d And b = c Then
n = n + 1
End If
Next i
Print n
End Sub
11.1953
Private Sub Command1_Click()
n = 0: s = 0
While s < 2000
n = n + 1
s = s + n
Wend
If s > 2000 Then
s = s - n
Else
s = s
End If
Print s
End Sub
Private Sub Command1_Click()
s = 0
For i = 100 To 999
A = i \ 100
B = i \ 10 Mod 10
c = i Mod 10
If A <> B And B <> c And c <> A And i = A ^ 3 + B ^ 3 + c ^ 3 Then
s = s + i
End If
Next i
Print s
End Sub
2.12
Private Sub Command1_Click()
Dim f As Boolean
s = 0
For i = 100 To 666
A = i \ 100
B = i \ 10 Mod 10
c = i Mod 10
If (B + c) Mod 10 = A Then
f = True
End If
For x = 2 To i - 1
If i Mod x = 0 Then
f = False
Exit For
End If
Next x
If f Then
s = s + 1
End If
Next i
Print s
End Sub
3.62730
Private Sub Command1_Click()
s = 0
For i = 10 To 500
If i Mod 2 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
4.31800
Private Sub Command1_Click()
s = 0
For i = 200 To 1000
If i Mod 3 = 0 And i Mod 5 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
5.6
Private Sub Command1_Click()
n = 0
For i = 0 To 9
For j = o To 9
For k = o To 9
If (i * 100 + j * 10 + k) + (k * 100 + j * 10 + i) = 1333 Then
n = n + 1
End If
Next k
Next j
Next i
Print n
End Sub
6.19731
Private Sub Command1_Click()
s = 0
For i = 101 To 999 Step 2
a = i \ 100
b = i \ 10 Mod 10
c = i Mod 10
If (a + b + c) Mod 15 = 0 Then
s = s + i
End If
Next i
Print s
End Sub
7.26
Private Sub Command1_Click()
n = 0
For i = 100 To 650
If i Mod 3 = 0 And i Mod 7 = 0 Then
n = n + 1
End If
Next i
Print n
End Sub
8.25
Private Sub Command1_Click()
n = 2
Dim a(30) As Long
Dim i As Integer
a(1) = 1: a(2) = 1
For i = 3 To 30
a(i) = a(i - 1) + a(i - 2)
If a(i) < 100000 Then
n = n + 1
End If
Next i
Print n
End Sub
9.9227465
Private Sub Command1_Click()
Dim a(35) As Long
Dim i As Integer
a(1) = 1: a(2) = 1
For i = 3 To 35
a(i) = a(i - 1) + a(i - 2)
Next i
Print a(35)
End Sub
10.80
Private Sub Command1_Click()
n = 0
For i = 2000 To 9999
a = i \ 1000
b = i \ 100 Mod 10
c = i \ 10 Mod 10
d = i Mod 10
If a = d And b = c Then
n = n + 1
End If
Next i
Print n
End Sub
11.1953
Private Sub Command1_Click()
n = 0: s = 0
While s < 2000
n = n + 1
s = s + n
Wend
If s > 2000 Then
s = s - n
Else
s = s
End If
Print s
End Sub
展开全部
1.
153 370 371 407
代码:
Private Sub Command1_Click()
For i = 100 To 999
If Left(i, 1) <> Right(i, 1) And Left(i, 1) <> Mid(i, 2, 1) And Right(i, 1) <> Mid(i, 2, 1) Then
If i = Val(Left(i, 1)) ^ 3 + Val(Right(i, 1)) ^ 3 + Val(Mid(i, 2, 1)) ^ 3 Then Text1 = Text1 & Space(1) & i
End If
Next
End Sub
2.
101 211 239 257 293 349 367 431 523 541 569 587
代码:
Private Sub Command1_Click()
For i = 100 To 666
If Val(Left(i, 1)) = (Val(Right(i, 1)) + Val(Mid(i, 2, 1))) Mod 10 Then
For j = 1 To i
If i Mod j = 0 Then n = n + 1
Next
If n = 2 Then Text1 = Text1 & Space(1) & i
n = 0
End If
Next
End Sub
3.
62730
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 10 To 500
If i Mod 2 = 0 Then n = n + i
Next
Text1 = n
End Sub
4.
31800
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 200 To 1000
If i Mod 3 = 0 And i Mod 5 = 0 Then n = n + i
Next
Text1 = n
End Sub
6.
14985
代码:
Private Sub Command1_Click()
For i = 100 To 999
If i Mod 2 <> 0 And (Val(Right(i, 1)) + Val(Mid(i, 2, 1)) + Val(Right(i, 1))) Mod 15 = 0 Then n = n + i
Next
Text1 = n
End Sub
5.
6 个
代码:
Private Sub Command1_Click()
For i = 0 To 9
For j = 0 To 9
For k = 0 To 9
If Val(i & j & k) + Val(k & j & i) = 1333 Then n = n + 1
Next
Next
Next
Text1 = n
End Sub
7.
26个
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 100 To 650
If i Mod 3 = 0 And i Mod 7 = 0 Then n = n + 1
Next
Text1 = n
End Sub
8.9题 不懂
10.
80个
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 2000 To 9999
If i = Val(StrReverse(i)) Then n = n + 1
Next
Text1 = n
End Sub
11.
1953
代码:
Private Sub Command1_Click()
Dim i As Integer
Dim n As Integer
Do
n = n + 1
If i + n < 2000 Then
i = i + n
Else
Text1 = i
Exit Do
End If
Loop
End Sub
153 370 371 407
代码:
Private Sub Command1_Click()
For i = 100 To 999
If Left(i, 1) <> Right(i, 1) And Left(i, 1) <> Mid(i, 2, 1) And Right(i, 1) <> Mid(i, 2, 1) Then
If i = Val(Left(i, 1)) ^ 3 + Val(Right(i, 1)) ^ 3 + Val(Mid(i, 2, 1)) ^ 3 Then Text1 = Text1 & Space(1) & i
End If
Next
End Sub
2.
101 211 239 257 293 349 367 431 523 541 569 587
代码:
Private Sub Command1_Click()
For i = 100 To 666
If Val(Left(i, 1)) = (Val(Right(i, 1)) + Val(Mid(i, 2, 1))) Mod 10 Then
For j = 1 To i
If i Mod j = 0 Then n = n + 1
Next
If n = 2 Then Text1 = Text1 & Space(1) & i
n = 0
End If
Next
End Sub
3.
62730
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 10 To 500
If i Mod 2 = 0 Then n = n + i
Next
Text1 = n
End Sub
4.
31800
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 200 To 1000
If i Mod 3 = 0 And i Mod 5 = 0 Then n = n + i
Next
Text1 = n
End Sub
6.
14985
代码:
Private Sub Command1_Click()
For i = 100 To 999
If i Mod 2 <> 0 And (Val(Right(i, 1)) + Val(Mid(i, 2, 1)) + Val(Right(i, 1))) Mod 15 = 0 Then n = n + i
Next
Text1 = n
End Sub
5.
6 个
代码:
Private Sub Command1_Click()
For i = 0 To 9
For j = 0 To 9
For k = 0 To 9
If Val(i & j & k) + Val(k & j & i) = 1333 Then n = n + 1
Next
Next
Next
Text1 = n
End Sub
7.
26个
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 100 To 650
If i Mod 3 = 0 And i Mod 7 = 0 Then n = n + 1
Next
Text1 = n
End Sub
8.9题 不懂
10.
80个
代码:
Private Sub Command1_Click()
Dim n As Long
For i = 2000 To 9999
If i = Val(StrReverse(i)) Then n = n + 1
Next
Text1 = n
End Sub
11.
1953
代码:
Private Sub Command1_Click()
Dim i As Integer
Dim n As Integer
Do
n = n + 1
If i + n < 2000 Then
i = i + n
Else
Text1 = i
Exit Do
End If
Loop
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1.
dim i,j,k,sum
for i=1 to 9
for j=0 to 9
for k=0 to 9
if i<>j and i<>k and j<>k and (i*100+j*10+k)=(i^3+j^3+k^3) then sum=sum+i*100+j*10+k
next k
next j
next i
msgbox sum
2.
dim i,j,a,b,c,f,sum
for i=100 to 666
a=i\100
b=(i-a*100)\10
c=i-a*100-b*10
if (b+c) mod 10=a then
f=true
for j=2 to i-1
if i mod j=0 then f=false:exit for
next j
if f then sum=sum+1
next i
msgbox sum
3.
dim i,sum
for i=10 to 500 step 2
sum=sum+i
next
msgbox sum
4.
dim i,sum
for i=200 to 1000
if i mod 3+i mod 5=0 then sum=sum+i
next
msgbox sum
5.
dim i,j,k,a
for i=0 to 9
for j=0 to 9
for k=0 to 9
if i*100+j*10+k+k*100+j*10+i=1333 then a=a+1
next k
next j
next i
msgbox a
6.
dim i,j,k,sum
for i=1 to 9
for j=0 to 9
for k=1 to 9 step 2
if (i+j+k) mod 15=0 then sum=sum+i
next k
next j
next i
msgbox sum
7.
dim i,j
for i=100 to 650
if i mod 3+i mod 7=0 then j=j+1
next
msgbox j
10.
dim i,j
for i=2000 to 9999
if left(cstr(i),2)=right(cstr(i),1) & mid(cstr(i),3,1) then j=j+1
next
msgbox j
11.
dim i,sum
i=0
do
i=i+1
sum=sum+i
loop while sum<2000
msgbox sum-i
第9和第8题回头查下资料再做
dim i,j,k,sum
for i=1 to 9
for j=0 to 9
for k=0 to 9
if i<>j and i<>k and j<>k and (i*100+j*10+k)=(i^3+j^3+k^3) then sum=sum+i*100+j*10+k
next k
next j
next i
msgbox sum
2.
dim i,j,a,b,c,f,sum
for i=100 to 666
a=i\100
b=(i-a*100)\10
c=i-a*100-b*10
if (b+c) mod 10=a then
f=true
for j=2 to i-1
if i mod j=0 then f=false:exit for
next j
if f then sum=sum+1
next i
msgbox sum
3.
dim i,sum
for i=10 to 500 step 2
sum=sum+i
next
msgbox sum
4.
dim i,sum
for i=200 to 1000
if i mod 3+i mod 5=0 then sum=sum+i
next
msgbox sum
5.
dim i,j,k,a
for i=0 to 9
for j=0 to 9
for k=0 to 9
if i*100+j*10+k+k*100+j*10+i=1333 then a=a+1
next k
next j
next i
msgbox a
6.
dim i,j,k,sum
for i=1 to 9
for j=0 to 9
for k=1 to 9 step 2
if (i+j+k) mod 15=0 then sum=sum+i
next k
next j
next i
msgbox sum
7.
dim i,j
for i=100 to 650
if i mod 3+i mod 7=0 then j=j+1
next
msgbox j
10.
dim i,j
for i=2000 to 9999
if left(cstr(i),2)=right(cstr(i),1) & mid(cstr(i),3,1) then j=j+1
next
msgbox j
11.
dim i,sum
i=0
do
i=i+1
sum=sum+i
loop while sum<2000
msgbox sum-i
第9和第8题回头查下资料再做
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询