1 Star 0 Fork 65

欢喜派/C-Sharp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
PowersOf10Sequence.cs 851 Bytes
一键复制 编辑 原始数据 按行查看 历史
using System.Collections.Generic;
using System.Numerics;
namespace Algorithms.Sequences
{
/// <summary>
/// <para>
/// Sequence of powers of 10: a(n) = 10^n.
/// </para>
/// <para>
/// Wikipedia: https://wikipedia.org/wiki/Power_of_10.
/// </para>
/// <para>
/// OEIS: https://oeis.org/A011557.
/// </para>
/// </summary>
public class PowersOf10Sequence : ISequence
{
/// <summary>
/// Gets sequence of powers of 10.
/// </summary>
public IEnumerable<BigInteger> Sequence
{
get
{
var n = new BigInteger(1);
while (true)
{
yield return n;
n *= 10;
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Joypai/C-Sharp.git
git@gitee.com:Joypai/C-Sharp.git
Joypai
C-Sharp
C-Sharp
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385