Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use regular Discriminant Primes in VBS

Shulou Source: shulou.com Published: 2022-06-03 07:15:18 09月20日 Update

This article mainly shows you "how to use regular discriminant primes in VBS". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use regular discriminant primes in VBS".

The copy code is as follows:

Set regex = New RegExp

Regex.Pattern = "^ 1 million $million ^ (11 percent?)\ 1 percent $"

For I = 1 To 100

If Not regex.Test (String (I, "1")) Then

WScript.Echo i

End If

Next

You will be dismissive when you see the title. Who won't enumerate prime numbers?

The copy code is as follows:

For I = 1 To 100

For j = 2 To I

If i Mod j = 0 Then Exit For

Next

If j = I Then WScript.Echo I

Next

It can be done in a few lines of code, it's so simple. Then take a look at the following program!

The copy code is as follows:

Set regex = New RegExp

Regex.Pattern = "^ 1 million $| ^ (11 percent?)\ 1 percent $"

For I = 1 To 100

If Not regex.Test (String (I, "1")) Then

WScript.Echo i

End If

Next

The above is all the contents of the article "how to use regular discriminant primes in VBS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Code rules primes discrimination content articles learning help disdain easy to understand more organization title knowledge procedures editing industry prime numbers information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple NVidia Docker OPPO Reno