C#控制台应用程序,求孪生素数的?

  1. 图片说明
  2. 图片说明我刚学C#对这个题一点没有头绪,麻烦大佬加点注释。谢谢~
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Q704605
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<int, bool> isPrime = x => x >=2 && !Enumerable.Range(2, x - 2).Any(y => x % y == 0);
            string input = Console.ReadLine();
            int l = int.Parse(input.Split(' ')[0]);
            int h = int.Parse(input.Split(' ')[1]);
            if (h <= l) 
                Console.WriteLine("Inputting illegal characters.");
            else
                Enumerable.Range(l, h - l + 1)
                    .Where(isPrime)
                    .Aggregate(l - 3, (acc, curr) => { if (curr - acc == 2) Console.WriteLine(acc + " " + curr); return curr; });
        }
    }
}

图片说明

如果问题得到解决,请点我回答右边的采纳,谢谢