Skip to content

Instantly share code, notes, and snippets.

@kuuso
Created September 19, 2014 11:57
Show Gist options
  • Save kuuso/1b4595a799feb7a47133 to your computer and use it in GitHub Desktop.
Save kuuso/1b4595a799feb7a47133 to your computer and use it in GitHub Desktop.
BEGIN {
// your code goes here
}
{
// your code goes here
}
END {
// your code goes here
for(i=1;++i<998;printf!a[i]?i%2?":"i:i:"")for(j=i;j<999;)a[j+=i]=1
}
##
## main部分 65字
##
## エラトステネスの篩で、
##  iが素数でない→ "" を出力
##  iが素数   → iが偶数 → i を出力
##           iが偶数でない→ :i を出力
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment