Skip to content

Instantly share code, notes, and snippets.

@idoushiki
Last active November 28, 2017 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idoushiki/dc2df7f720395a811ceddd6969471640 to your computer and use it in GitHub Desktop.
Save idoushiki/dc2df7f720395a811ceddd6969471640 to your computer and use it in GitHub Desktop.
素数のやつ
<html>
<body>
<script>
var n,i,flg=0;
for(n=2;n<=100;n++){
for(i=2;i<=n;i++){
if(n%i==0)
flg++;
if(i==n){
if(flg==1){
document.write(n+"<br>");
}
flg=0;
}
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment