C#判断素数的一个方法public class Primes{private long min;private long max;public Primes() :this(2,100) //为什么会有this(2,100)?这个有什么作用?{}public Primes(long minimum,long maximum){if (min min = 2;elsemin = minimum;max = maximum;}public IEnumerator GetEnumerator(){for (long possiblePrime = min; possiblePrime

问题描述:

C#判断素数的一个方法
public class Primes
{
private long min;
private long max;
public Primes() :this(2,100) //为什么会有this(2,100)?这个有什么作用?
{
}
public Primes(long minimum,long maximum)
{
if (min min = 2;
else
min = minimum;
max = maximum;
}
public IEnumerator GetEnumerator()
{
for (long possiblePrime = min; possiblePrime

public Primes() : this(2, 100) //是对自身构造函数的一个重载 {} //就是对这个构造函数的重载 public Primes(long minimum, long maximum) { if (min