・ ・ ・ ・ ・ ・ ・ ・ ・ ・  →次へトップへ戻る
その1. まずは、「ある数」の約数をすべて求めてみます。

サンプルと結果 (144の約数を求めています。)

ソース(スクリプト側)
<script>
function common_divisor_1(cd_L){

	document.write(cd_L,'
'); document.write('********************
'); for (i=0; i < cd_L; i++){ cd = cd_L - i; cd_with_rest_L = cd_L/(cd); cd_check_L = cd_with_rest_L-Math.floor(cd_with_rest_L); if(cd_check_L == 0){ document.write(cd); document.write('
'); } } } </script>
ソース(呼び出し側)
<script>
common_divisor_1(144)
</script>

・・・・・・・・・・>もどる。