Last active
November 28, 2017 15:28
-
-
Save idoushiki/dc2df7f720395a811ceddd6969471640 to your computer and use it in GitHub Desktop.
素数のやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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