using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        private delegate bool Del(int score);

        private static bool CheckPassed(int score)
        {
            if (score < 60)
                return true;
            else
                return false;

        }

        private static void Print(int value)
        {
            Console.Write("{0} ", value);
        }

     

        static void Main(string[] args)
        {
            int[] scores = new int[] { 80, 74, 81, 90, 34 };
            int _nindex = Array.FindIndex<int>(scores, new Predicate<int>(new Del(CheckPassed)));
            Console.WriteLine("{0}", _nindex);
            Array.ForEach<int>(scores,new Action<int>(Print));
        }
    }
}

'개발 > Algorithm' 카테고리의 다른 글

자체참조 구조체 스택을 활용한 트리의 순회  (0) 2015.06.03
큐 랜덤 넣고 빼고  (0) 2015.05.13
All New 이중연결리스트  (0) 2015.05.11
실습과제#2  (0) 2014.09.26
Insertion_Sort  (0) 2014.09.23
블로그 이미지

잉비니

,