using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace lianxuzhengshu
{
class Program
{
static void Main(string[] args)
{
Stopwatch sw = new Stopwatch();
sw.Start();
int i=0,j=0,sum=0;
Console.WriteLine("请输入一个整数:");
string str=Console.ReadLine();
int y = Convert.ToInt32(str);
for ( i = 1; i < y/2; i++)
{
j = i + 1;
sum = i;
for (; j < y / 2;j++ )
{
sum +=j;
} //第二个
}//第一个
if (sum == y && j != i)
{
Console.WriteLine(" " + i + " " + j);
Console.WriteLine();
}
else
{
Console.WriteLine("不存在满足条件的序列!");
}