随笔分类 -  算法基础

摘要:质数又称素数。一个大于1的自然数,除了1和它自身外,不能被其他自然数整除的数叫做质数; function solution(num) { if (num <= 1) { return '数据错误' } else { let state = true for(let i=2;i<num;i++){ i 阅读全文
posted @ 2022-11-11 17:45 知兮 阅读(24) 评论(0) 推荐(0) 编辑
摘要:let arr = [1,2,6,6,7,8,11,12,13,4,4] let num = 12 function solution(arr, target) { console.log('给出指定数组 >', arr) console.log('给出指定数 >', target) const l 阅读全文
posted @ 2022-11-11 17:41 知兮 阅读(260) 评论(0) 推荐(0) 编辑