{"id":159727,"student_id":10,"content":"//noprotect\n\nvar startTime = Date.now();\nvar best;\n\n// for (var i=0; i\u003c=100000; i++) { \n// if (isPrime(i)) best = i;\n// }\n\n// function isPrime (n) {\n// for (var i = 2; i \u003c n; i++) {\n// if (n % i == 0) {\n// return false;\n// }\n// }\n// return true;\n// }\n\n// function isPrime (n) {\n// if (n % 2 == 0) return false;\n// for (var i = 3; i\u003cn; i += 2) {\n// if (n % i == 0) return false;\n// }\n// return true;\n// }\n\nfunction isPrime (n) {\n \n if (n % 2 == 0) return;\n \n var nSqrt = Math.floor(Math.sqrt(n));\n \n for (var i = 2; i \u003c= nSqrt; i++) {\n if (n % i == 0) return false;\n }\n return true;\n}\n\nvar time = Date.now() - startTime;\n\nconsole.log(`花費時間 ${time} ms`);\n// console.log(`找到最大質數 ${best}`);\n","created_at":"2020-06-18T18:50:21.475+08:00","updated_at":"2020-07-15T16:46:40.507+08:00","name":"尋找質數_講解效率_概念","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/159727/fd1ac05835b665cf0d7e3c5532c7c2d7.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":252,"hashid":"gk4sd58k","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦