质数小例子

C
fn main(){
  mut canditates, mut primes, mut prime := 
      []int{}, []int{}, 0
  for i in 2..101 {
    canditates << i
  }
  for canditates.len > 0 {
    prime = canditates[0]
    primes << prime
    canditates = canditates.filter(it % prime != 0)
  }
  println(primes)
  println(primes.len)
}

Hey! Want to join a camp talk like this, come sign up an account.