Created
September 11, 2012 13:29
-
-
Save kawakawa/3698473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim Array() As Integer = {1, 10, 30, 40, 50, 70, 80, 90} | |
'50以上の値の数(for) | |
Dim Count As Integer | |
Dim I As Long | |
For I = 0 To Array.Length - 1 | |
If Array(I) >= 50 Then | |
Count = Count + 1 | |
End If | |
Next | |
Console.WriteLine(Count) | |
'50以上の値の数(LINQ) | |
Dim CountLinq = From n In Array Where n >= 50 | |
Console.WriteLine(CountLinq.Count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment