求VB大神告诉一下 非常感谢 10
求四位平方数的个数个位和百位数相同十位与个位数相同是某一个二位数的平方题目如上,这个怎样编程。非常感谢...
求四位平方数的个数 个位和百位数相同 十位与个位数相同 是某一个二位数的平方
题目如上,这个怎样编程。非常感谢 展开
题目如上,这个怎样编程。非常感谢 展开
2个回答
展开全部
Dim x As Long, n2 As Integer, n3 As Integer, n4 As Integer, k As Long
For x = 32 To 99
k = x ^ 2
n2 = Mid(k, 2, 1)
n3 = Mid(k, 3, 1)
n4 = Mid(k, 4, 1)
If n2 = n4 And n3 = n4 Then Print k
Next
For x = 32 To 99
k = x ^ 2
n2 = Mid(k, 2, 1)
n3 = Mid(k, 3, 1)
n4 = Mid(k, 4, 1)
If n2 = n4 And n3 = n4 Then Print k
Next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
Private Sub Form_Load()
Dim i As Integer
Dim k As Integer
Dim j As Integer
Dim shiwei As String
Dim baiwei As String
Dim gewei As String
Dim qianwei As String
Dim strshu As String
For i = 10 To 99
k = i * i
strshu = Trim(Str(k))
If Len(strshu) = 4 Then
qianwei = Mid(strshu, 1, 1)
baiwei = Mid(strshu, 2, 1)
shiwei = Mid(strshu, 3, 1)
gewei = Mid(strshu, 4, 1)
If (qianwei = shiwei) And (baiwei = gewei) Then
j = j + 1
End If
End If
Next i
Text1.Text = j
End Sub
Dim i As Integer
Dim k As Integer
Dim j As Integer
Dim shiwei As String
Dim baiwei As String
Dim gewei As String
Dim qianwei As String
Dim strshu As String
For i = 10 To 99
k = i * i
strshu = Trim(Str(k))
If Len(strshu) = 4 Then
qianwei = Mid(strshu, 1, 1)
baiwei = Mid(strshu, 2, 1)
shiwei = Mid(strshu, 3, 1)
gewei = Mid(strshu, 4, 1)
If (qianwei = shiwei) And (baiwei = gewei) Then
j = j + 1
End If
End If
Next i
Text1.Text = j
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询