会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zhongta
博客园
首页
新随笔
联系
订阅
管理
2024年4月26日
用筛选法求1000内的素数
摘要: 1.先将1挖掉 2.用2除它以后的各个数,把能被2整除的数挖掉 3.依次处理3,4,5,6 sqrt(n)的数 4.挖掉的数设为0,不为0的数就是素数。(用数组存储) #include<stdio.h> #include<math.h> int main(void){ int number[1000
阅读全文
posted @ 2024-04-26 11:09 zhongta
阅读(94)
评论(0)
推荐(0)
公告