Поиск одинаковых элементов массива - C# (178717)
Формулировка задачи:
List<Good> arr = new List<Good>(); Good a = new Good { price = 10, date = "10.10.2017" }; Good b = new Good { price = 1, date = "10.10.2017" }; Good c = new Good { price = 2, date = "10.10.2017" }; Good d = new Good { price = 3, date = "11.10.2017" }; Good e = new Good { price = 5, date = "11.10.2017" }; Good p = new Good { price = 5, date = "12.10.2017" }; Good o = new Good { price = 5, date = "13.10.2017" }; arr.Add(a); arr.Add(b); arr.Add(c); arr.Add(d); arr.Add(e); arr.Add(p); arr.Add(o);
Решение задачи: «Поиск одинаковых элементов массива»
textual
Листинг программы
List<Good> arr = new List<Good>(); arr.Add(new Good { price = 45, date = "2009-01-01" }); arr.Add(new Good { price = 25, date = "2009-01-01" }); arr.Add(new Good { price = 50, date = "2009-01-02" }); arr.Add(new Good { price = 32, date = "2009-01-02" }); arr.Add(new Good { price = 45, date = "2009-01-03" }); arr.Add(new Good { price = 25, date = "2009-01-03" }); arr.Add(new Good { price = 50, date = "2009-02-01" }); arr.Add(new Good { price = 32, date = "2009-02-01" }); arr.Add(new Good { price = 45, date = "2009-02-01" }); arr.Add(new Good { price = 25, date = "2009-02-01" }); arr.Add(new Good { price = 50, date = "2009-03-02" }); arr.Add(new Good { price = 32, date = "2009-03-02" }); arr.Add(new Good { price = 45, date = "2009-04-03" }); arr.Add(new Good { price = 25, date = "2009-04-03" }); arr.Add(new Good { price = 50, date = "2009-05-01" }); arr.Add(new Good { price = 32, date = "2009-05-01" }); arr.Add(new Good { price = 45, date = "2009-06-01" });
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д