using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; using System.Net.Sockets; using System.Net; namespace CFrame { class Program { static void Main(string[] args) { List<string> list = new List<string>(); LinkedList<string> linkedlist = new LinkedList<string>(); Dictionary<Int32, string> dict = new Dictionary<int, string>(); HashSet<string> set = new HashSet<string>(); for (int i = 0; i < 10; i++) { list.Add(i.ToString()); linkedlist.AddLast(i.ToString()); dict.Add(i,i.ToString()); set.Add(i.ToString()); } Console.WriteLine("List:"); foreach (var item in list) { Console.WriteLine(item); } Console.WriteLine("\nLinkedList:"); foreach (var item in linkedlist) { Console.WriteLine(item); } Console.WriteLine("\nDictionary:"); foreach (var item in dict) { Console.WriteLine(item); } Console.WriteLine("\n HashSet:"); foreach (var item in set) { Console.WriteLine(item); } Console.Read(); } } } |
|