标签:
<html> <head> <title>判断素数</title> </head> <script> var N; N = parseInt(prompt("N=","")); var flag = 0; for(var j=2;j < N;j++){ if(N%j==0){ flag = 1; } break; } if(flag) { alert(N+":Composite"); } else{ alert(N+":Prime"); } </script> <body> </body> </html>
标签:
原文地址:http://www.cnblogs.com/ink-grass/p/5451109.html