我知道一切都非常错误。我想要做的是创建一个素数列表,包括给定的数字。请尽量简单解释。我是新手。非常感谢您的帮助!
Option Explicit On
Option Strict On
'Author: Murray Spears
'Date: October 5th 2012
'Creating a Program that will ask the user for a number.
'The program will then generate prime numbers up to and including the number entered by the user.
Imports System
Module PrimeNumbers
Sub Main()
Dim Number As Integer
Dim One As Integer = 1
Dim Prime As Boolean
'Ask the user for their chosen number.
Console.Writeline("Choose a number:")
Number = Convert.ToInt32(Console.Readline())
' We have to let the program know that we only want numbers that are divisible by one and themselves, up to the entered value.
Do While Number <= Number
Loop
Do While Number / One = Number
Loop
Do While Number / Prime = Number
Loop
Console.Out.Writeline("Here are the prime numbers:")
Console.Out.Writeline(Number)
End Sub
End Module