写一个正则表达式,判断一个数是否为素数?

系统消息 若觉得内容不错,请点击左上角的"赞"图标,以优化网站的内容呈现。 另外,请及时验证注册邮箱,否则收不到21QA发出的红包。 官方Q群:250203055

asked 30 Jul '14, 23:09

%E8%B7%AF%E4%BA%BA%E7%94%B2's gravatar image

路人甲
131528584621


在Linux下调出字符终端,输入以下命令,接下来是见证奇迹的时候~

perl -e'$|++;(1 x$_)!~/^1?$|^(11+?)\1+$/&&print"$_ "while ++$_'
系统消息 若觉得内容不错,请点击左上角的"赞"图标,以优化网站的内容呈现。 另外,请及时验证注册邮箱,否则收不到21QA发出的红包。 官方Q群:250203055
permanent link

answered 30 Jul '14, 23:11

%E8%B7%AF%E4%BA%BA%E7%94%B2's gravatar image

路人甲
131528584621

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link: [text](http://url.com/ "title")
  • image: ![alt](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1
×1

question asked: 30 Jul '14, 23:09

question was seen: 1,721 times

last updated: 30 Jul '14, 23:11

Related questions

powered by O*S*Q*A

粤ICP备14040061号-1