📜  c 列表添加元素 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:19.651000             🧑  作者: Mango

代码示例2
using System;
using System.Collections.Generic;
 
class Program {
    static void Main(string[] args) {
        //empty list
        List nums = new List();
 
        //add elements to list
        nums.Add(63);
        nums.Add(58);
        nums.Add(47);
         
        //print list
        foreach (int num in nums) {
            Console.WriteLine(num);
        }
    }
}
Run the above C# program. The three items shall be added to the list.

Output

63
58
47