/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/array1.vb
20 строк
826 B
Genevieve Warren
Move member remarks (#39270)
30 янв 2024, 00:43
Не верифицирован
30 янв 2024, 00:43
6c88824
Код
Авторство
О чём код?
' Visual Basic .NET Document Option Strict On ' <Snippet10> Module Example1 Public Sub Main() Dim cities() As String = {"Atlanta", "Boston", "Chicago", "Detroit", "Fort Wayne", "Greensboro", "Honolulu", "Indianapolis", "Jersey City", "Kansas City", "Los Angeles", "Milwaukee", "New York", "Omaha", "Philadelphia", "Raleigh", "San Francisco", "Tulsa", "Washington"} Dim rnd As New Random() Dim index As Integer = rnd.Next(0, cities.Length) Console.WriteLine("Today's city of the day: {0}", cities(index)) End Sub End Module ' The example displays output like the following: ' Today's city of the day: Honolulu ' </Snippet10>