Skip to content

Instantly share code, notes, and snippets.

@keedi
Created April 16, 2010 04:13
Show Gist options
  • Save keedi/367997 to your computer and use it in GitHub Desktop.
Save keedi/367997 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use 5.010;
use common::sense;
use Math::Prime::TiedArray;
use List::Compare;
#
# 실행전 설치 모듈 확인
# $ cpanm common::sense Math::Prime::TiedArray List::Compare
#
# 2 부터 100까지의 숫자 중 소수가 아닌 수 구하기
tie my @primes, "Math::Prime::TiedArray", precompute => 100;
say "$_ " for sort { $a <=> $b } List::Compare->new('--unsorted', \@primes, [ 2 .. 100 ])->get_complement;
@simryang
Copy link

good~ thnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment