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; });
}
}
}
如果问题得到解决,请点我回答右边的采纳,谢谢