帮忙写个程序,谢谢!
题目是: 请编程实现找出1-100之间的所有素数,输出形式自己拟定,请上交源代码。
帮忙写个程序,谢谢!
题目是: 请编程实现找出1-100之间的所有素数,输出形式自己拟定,请上交源代码。
Dim i As Integer, j As Integer, k As Integer
For i = 1 To 100
For j = 2 To Sqr(i)
If i = Int(i / j + 0.1) * j Then k = 1: Exit For
Next j
If k = 0 Then Text1 = Text1 & i & " "
k = 0
Next i