1 Star 0 Fork 63

雁秋 / C-Sharp

forked from 编程语言算法集 / C-Sharp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
NegativeIntegersSequence.cs 834 Bytes
一键复制 编辑 原始数据 按行查看 历史
using System.Collections.Generic;
using System.Numerics;
namespace Algorithms.Sequences
{
/// <summary>
/// <para>
/// Sequence of negative integers.
/// </para>
/// <para>
/// Wikipedia: https://wikipedia.org/wiki/Negative_number.
/// </para>
/// <para>
/// OEIS: http://oeis.org/A001478.
/// </para>
/// </summary>
public class NegativeIntegersSequence : ISequence
{
/// <summary>
/// Gets sequence of negative integers.
/// </summary>
public IEnumerable<BigInteger> Sequence
{
get
{
var n = new BigInteger(-1);
while (true)
{
yield return n--;
}
}
}
}
}
C#
1
https://gitee.com/xyesterday/C-Sharp.git
git@gitee.com:xyesterday/C-Sharp.git
xyesterday
C-Sharp
C-Sharp
master

搜索帮助