绝对素数.frm

来自「一个自然数是素数,且它的数字位置经过任意对换后仍为素数,刚称为绝对素数,例如:1」· FRM 代码 · 共 50 行

FRM
50
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   615
      Left            =   2880
      TabIndex        =   0
      Top             =   2160
      Width           =   1455
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
Dim pt As Boolean, qt As Boolean
For i = 10 To 99
pt = False
s = 0
For j = 2 To i - 1
If i Mod j = 0 Then s = s + 1
Next j
If s = 0 Then pt = True
If pt Then
q = (i Mod 10) * 10 + (i \ 10)
t = 0
For k = 2 To q - 1
qt = False
If q Mod k = 0 Then t = t + 1
Next k
If t = 0 Then qt = True
End If
If (pt And qt) Then Print i; "是绝对素数"
Next i
End Sub


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?