過去ログ

ゴンとも
○を0,×を1として問題図に以下のように英文字を振って

//////a/b
////c/d/e
//f/g/h/
i/j/k
l/m

十進basic で

for a=0 to 1
for b=0 to 1
if b=0 and a=0 then goto 120
for c=0 to 1
for d=0 to 1
if d=0 and (a=0 or c=0) then goto 100
for e=0 to 1
if e=0 and (b=0 or d=0) then goto 90
for f=0 to 1
for g=0 to 1
if g=0 and (c=0 or f=0) then goto 70
for h=0 to 1
if h=0 and (d=0 or g=0) then goto 60
for i=0 to 1
for j=0 to 1
if j=0 and (f=0 or i=0) then goto 40
for k=0 to 1
if k=0 and (g=0 or j=0) then goto 30
for l=0 to 1
if l=0 and i=0 then goto 20
for m=0 to 1
if m=0 and (j=0 or l=0) then goto 10
let s=s+1
10 next m
20 next l
30 next k
40 next j
50 next i
60 next h
70 next g
80 next f
90 next e
100 next d
110 next c
120 next b
130 next a
print s;"通り・・・・・・(答え)"
end

f9押して 533 通り・・・・・・(答え)
豊川市   3月20日(木) 0:41:16   MAIL:fttnm528@ybb.ne.jp   41564

過去問題一覧へ戻る