// hashset.cs using System; using System.Collections.Generic; class Program { static void Main() { string lincoln = "government of the people by the people for the people"; // HashSetクラスによる単語テーブル HashSet hsTable = new HashSet(); foreach (string word in lincoln.Split(' ')) { // 単語を追加。未登録なら表示 if (hsTable.Add(word)) { Console.WriteLine(word); } } } } // コンパイル方法:csc hashset.cs