VB求1000到1100所有的素数

学习 时间:2026-11-11 02:31:22 阅读:1065
用do while循环语句

最佳回答

外向的烤鸡

殷勤的溪流

2026-11-11 02:31:22

Option Explicit'添加一个按钮Command1Private Function SS(ByVal num As Long) As BooleanDim i As LongFor i = 2 To num / 2If num Mod i = 0 ThenSS = FalseExit FunctionEnd IfSS = TrueNextEnd FunctionPrivate Sub Command1_Click()Dim n As Long, count As IntegerFor n = 1000 To 1100If SS(n) Then If count Mod 6 = 0 And count <> 0 Then Print "" count = count + 1 Print n;End IfNextEnd Sub

最新回答共有2条回答

  • 健康的月饼
    回复
    2026-11-11 02:31:22

    Option Explicit'添加一个按钮Command1Private Function SS(ByVal num As Long) As BooleanDim i As LongFor i = 2 To num / 2If num Mod i = 0 ThenSS = FalseExit FunctionEnd IfSS = TrueNextEnd FunctionPrivate Sub Command1_Click()Dim n As Long, count As IntegerFor n = 1000 To 1100If SS(n) Then If count Mod 6 = 0 And count <> 0 Then Print "" count = count + 1 Print n;End IfNextEnd Sub

上一篇 这句英语“☆GO FIGHT WIN!

下一篇 描写人物动作的片段小说里的书里的还要有赏析的