CODEKILLER

반응형

Linq - Enumerable.Skip 출력.
Linq - Enumerable.Skip 출력.

public class Example
{
    public static void Main()
    {
        Console.Write("<< Linq - Enumerable.Skip 출력 예제 >> \n");

        int[] grades = { 59, 82, 70, 56, 92, 98, 85 };

        IEnumerable<int> codeGrades =
            grades.OrderByDescending(g => g).Skip(4);

        Console.WriteLine("상위 4개를 제외한 등급출력 : ");
        foreach (int grade in codeGrades)
        {
            Console.WriteLine(grade);
        }

        Console.WriteLine(System.Environment.NewLine);
        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
}

 

반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band