過去ログ

ゴンとも
十進Basic で問題文のマス目を

abcde
fghij
klmno
pqrst
uvwxy とおいて 変数を○を0,●を1として

for a=0 to 1
for b=0 to 1
for c=0 to 1
for d=0 to 1
for e=0 to 1
for f=0 to 1
for g=0 to 1
if a+b+f+g<>2 then goto 190
for h=0 to 1
if b+c+g+h<>2 then goto 180
for i=0 to 1
if c+d+h+i<>2 then goto 170
for j=0 to 1
if d+e+i+j<>2 then goto 160
for k=0 to 1
for l=0 to 1
if f+g+k+l<>2 then goto 140
for m=0 to 1
if g+h+l+m<>2 then goto 130
for n=0 to 1
if h+i+m+n<>2 then goto 120
for o=0 to 1
if i+j+n+o<>2 then goto 110
for p=0 to 1
for q=0 to 1
if k+l+p+q<>2 then goto 90
for r=0 to 1
if l+m+q+r<>2 then goto 80
for s=0 to 1
if m+n+r+s<>2 then goto 70
for t=0 to 1
if n+o+s+t<>2 then goto 60
for u=0 to 1
for v=0 to 1
if p+q+u+v<>2 then goto 40
for w=0 to 1
if q+r+v+w<>2 then goto 30
for x=0 to 1
if r+s+w+x<>2 then goto 20
for y=0 to 1
if s+t+x+y<>2 then goto 10
let z=z+1
10 next y
20 next x
30 next w
40 next v
50 next u
60 next t
70 next s
80 next r
90 next q
100 next p
110 next o
120 next n
130 next m
140 next l
150 next k
160 next j
170 next i
180 next h
190 next g
200 next f
210 next e
220 next d
230 next c
240 next b
250 next a
print z
end

f9押して 62・・・・・・(答え)
豊川市   9月17日(木) 0:40:50     43709

過去問題一覧へ戻る