Challenge: List Declaration
メニューを表示するにはスワイプしてください
Fill in the blanks to declare a list called numbers that stores integer numbers from 1 to 10. Use explicit declaration for declaring the list.
index.cs
12345678910111213using System; using System.Collections.Generic; class Program { static void Main(string[] args) { ___ ___ = ___ ___ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; foreach (int num in numbers) Console.Write(num + " "); } }
You declare empty lists by using the List<type> name = new List<type>(); syntax. Initializing a list with some data has a very similar syntax.
index.cs
12345678910111213using System; using System.Collections.Generic; class Program { static void Main(string[] args) { List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; foreach (int num in numbers) Console.Write(num + " "); } }
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 2
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 1. 章 2