perl的

来源: 2009-07-24 11:54:18 [旧帖] [给我悄悄话] 本文已被阅读:

打印Yes如果是大于2的质数

echo 11 | perl -ne 'print $_ == ($i + 2) ? "yes" : "" while ($_ % (2 + $i ++));'