Uses System.Collections.Generic; var a: array of string; b: List := new List(); f, g: string; begin readln(f, g); System.IO.File.WriteAllText(f, ''); System.IO.File.WriteAllText(g, ''); for k: byte := 1 to 10 do System.IO.File.AppendAllText(f, IntToStr(Random(25)) + System.Environment.NewLine); a := System.IO.File.ReadAllLines(f); foreach k: string in a do b.Add(StrToInt(k)); var i: integer; while (i < b.Count - 1) do begin while (b.IndexOf(b[i]) <> b.LastIndexOf(b[i])) do b.RemoveAt(b.LastIndexOf(b[i])); inc(i); end; foreach k: integer in b do System.IO.File.AppendAllText(g, IntToStr(k) + System.Environment.NewLine); end.