SSMMVO1

CSharp · Console

/Program.cs

using System;
using System.Linq;
using System.Collections.Generic;
					
public class Program
{
	public static void Main()
	{
		List<int> temp = new List<int> { 3, 5, 6, 8, 2, 1, 6};

            var query = temp.Where(x => x != temp.Min() && x != temp.Max()).ToList();

            foreach (int num in query)
            {
                Console.WriteLine(num);
            }
	}
}
;