VB VB VB VB

来源:百度知道 编辑:UC知道 时间:2024/05/09 20:36:50
设A为一个整数,如果a^2=x*a,成立,则称a为 守型数,如5^2=25,
25^=625,求1-1000以内的数,用函数(FUNCTION)调用。

Private Function shouxingshu(a As Long)
For i = 1 To a
temp = i ^ 2
If Len(temp) > Len(i) And i = (temp Mod 10 ^ Len(i)) Then
Print i
End If
Next
End Function

调用时:shouxingshu(1000)

FUNCTION 123()
If a^2=x*a Then
5^=625

End If
END FUNCTION

大体就是这么 只是把具体的数换成A就行了
其实不难就是要想对就行了