public delegate bool GetIsCondition(int s);
static class Extencions
{
public static IEnumerable<string> FindRes(this int[] num, GetIsCondition ds)
{
for (int i = 0; i < num.Length; i++)
{
if (ds(num[i]))
{
yield return num[i].ToString();
}
}
}
public static IEnumerable<int> test(this int[] o, int num)
{
GetIsCondition con = a => a/num==1;
foreach (int item in o)
{
if (con(item))
{
yield return item;
}
}
}
}
class Program
{
public bool IsNum(int i)
{
return i==3;
}
public static int[] num = new int[10];
public void test()
{
num.FindRes(a => a == 3);
}
public void testAll1()
{
IEnumerable<string> res= num.FindRes(IsNum);
}
public void testAll2()
{
IEnumerable<int> res = num.test(2);
}
static void Main(string[] args)
{
}
public static void AppendHash()
{
for (int i = 0; i < 10; i++)
{
num[i] = i;
}
}
}