3行目を12行目~28行目の中に入れてちょっと修正するといける。 修正前 if i/2==flool(i/2) then・・・ 修正後 if d!=0 && i/2==flool(i/2) then・・・