>>344
1の途中まで作成(ファイルに出力すれば完成)
ttp://kansai2channeler.hp.infoseek.co.jp/cgi-bin/joyful/img/8263.txt

>>352
n = B/x - (A-1)/x;
でおk