public Node(T value, Node<T> next)
public void SetValue(T value)
public void SetNext(Node<T> next)
public override string ToString()
public static bool ola(Node<int> n)
while (pos.GetNext() != null)
if (pos.GetValue() >= pos.GetNext().GetValue())
public static void Print(Node<int> n)
Console.WriteLine(pos.GetValue());
public static Node<int> bulid()
Console.WriteLine("enter number to end press -1");
num = int.Parse(Console.ReadLine());
head = new Node<int>(num);
pos.SetNext(new Node<int>(num));
Console.WriteLine("enter number to end press -1");
num = int.Parse(Console.ReadLine());
public static Node<int> zogi(Node<int> tal)
if (tal.GetValue() % 2 != 0)
while(pos.GetNext() != null)
if (pos.GetNext().GetValue() % 2 != 0)
pos.SetNext(temp.GetNext());
public static void Main()
Node<int> tal = Program.bulid();
Program.Print(Program.zogi(tal));