public class mo
    {
        public int q1 { get; set; }
        public int count { get; set; }
    }
    class Class1
    {
        static void Main(string[] args)
        {
            int[] a = new int[] { 1, 2, 3, 4, 5 };
            int[] b1 = new int[] { 1, 2, 3  };
            int[] c1 = new int[] { 1, 2, 3, 4, 5 };
            mo[] wer = new mo[]//第一种
            {
                new mo{q1=1,count=3},
            };
            int[][] io=new int[][] { new int[] { 1, 2 } };
            int[][] pi = new int[][] { b1, c1 };//第二种
            List<int[]> cd = new List<int[]> { a, b1, c1 };//第三种
            var re = from f in cd
                     from q in f
                     where q > 2
                     select new mo {

                         q1 = q,
                         count = f.Count()
                     };
            foreach (mo o in re)//输出
            {
                Console.WriteLine(o.q1);
                Console.WriteLine($"数量是:{o.count}");
            }
            foreach(int[] p in io)
            {
                foreach(int op in p)
                {
                    Console.WriteLine(op);
                }
            }

 

posted on 2023-07-15 17:10  阿霖找BUG  阅读(347)  评论(0编辑  收藏  举报