-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShopping.cs
43 lines (34 loc) · 1.07 KB
/
Shopping.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1._15thdec.Maxex
{
class Shopping
{
string clothesShop;
int clothePrice;
public Shopping(string clothesShop, int clothePrice)
{
this.clothesShop = clothesShop;
this.clothePrice = clothePrice;
}
public string ClothesShop { get => clothesShop; set => clothesShop = value; }
public int ClothePrice { get => clothePrice; set => clothePrice = value; }
static void Main(string[] args)
{
LinkedList<string> shop = new LinkedList<string>();
shop.AddFirst("T-shirt");
shop.AddFirst("Pants");
shop.AddFirst("bag");
shop.AddLast("Chapple");
LinkedListNode<string> node = shop.Find("bag");
shop.AddAfter(node, "Shirt");
foreach(var ss in shop)
{
Console.WriteLine(ss);
}Console.ReadLine();
}
}
}