Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Сollection
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- List<string> product = new List<string>();
- string[] set1 = new string[] { "Картошка", "Лук", "Морковь", "Греча", "Сметана", "Пикули", "Помидоры" };
- string[] set2 = new string[] { "Сметана", "Мясо", "Сухарики", "Рис", "Лук", "Помидоры", "Майонез" };
- for (int i = 0; i < set1.Length; i++)
- {
- if (product.Contains(set1[i]) == false)
- {
- product.Add(set1[i]);
- }
- }
- for (int i = 0; i < set2.Length; i++)
- {
- if (product.Contains(set2[i]) == false)
- {
- product.Add(set2[i]);
- }
- }
- for (int i = 0; i < product.Count; i++)
- {
- Console.WriteLine(product[i]);
- }
- Console.WriteLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment