過去ログ

ゴンとも
図の分岐点に以下のように番号を振って

s(00)////(01)////(04)////(07)////(11)////(15)g
/(02)(03)/(05)(08)(10)(12)/(14)(16)/(18)(19)/(21)
////(06)////(09)////(13)////(17)////(20)

十進Basic で

for a=1 to 2
for b=3 to 5
if b=a then goto 140
if a=1 and (b<>4 and b<>5) then goto 140
if a=2 and b<>3 then goto 140
for c=5 to 10
if c=a or c=b then goto 130
if b=3 and (c<>5 and c<>6) then goto 130
if b=4 and (c<>7 and c<>10) then goto 130
if b=5 and (c<>1 and c<>8) then goto 130
for d=1 to 14
if d=a or d=b or d=c or d=2 or d=3 or d=5 or d=6 then goto 120
if c=5 and (d<>1 and d<>8) then goto 120
if c=6 and d<>9 then goto 120
if c=7 and (d<>11 and d<>14) then goto 120
if c=8 and (d<>9 and d<>10) then goto 120
if c=9 and (d<>8 and d<>13) then goto 120
if c=10 and (d<>4 and d<>12) then goto 120
for e=4 to 18
if e=a or e=b or e=c or e=d or e=5 or e=6 then goto 110
if d=1 and (e<>4 and e<>5) then goto 110
if d=4 and (e<>7 and e<>10) then goto 110
if d=7 and (e<>11 and e<>14) then goto 110
if d=8 and (e<>9 and e<>10) then goto 110
if d=9 and (e<>8 and e<>13) then goto 110
if d=10 and (e<>4 and e<>12) then goto 110
if d=11 and (e<>15 and e<>18) then goto 110
if d=12 and (e<>13 and e<>14) then goto 110
if d=14 and (e<>7 and e<>16) then goto 110
if e=15 then let s1=s1+1
for f=4 to 20
if f=a or f=b or f=c or f=d or f=e or f=5 or f=6 or f=8 or f=9 then goto 100
if e=4 and (f<>7 and f<>10) then goto 100
if e=7 and (f<>11 and f<>14) then goto 100
if e=8 and (f<>9 and f<>10) then goto 100
if e=9 and (f<>8 and f<>13) then goto 100
if e=10 and (f<>4 and f<>12) then goto 100
if e=11 and (f<>15 and f<>18) then goto 100
if e=12 and (f<>13 and f<>14) then goto 100
if e=13 and (f<>12 and f<>17) then goto 100
if e=14 and (f<>7 and f<>16) then goto 100
if e=16 and (f<>17 and f<>18) then goto 100
if e=17 and (f<>16 and f<>20) then goto 100
if e=18 and (f<>11 and f<>19) then goto 100
if f=15 then let s2=s2+1
for g=4 to 21
if g=a or g=b or g=c or g=d or g=e or g=f or g=5 or g=6 or g=8 or g=9 or g=10 then goto 90
if f=4 and (g<>7 and g<>10) then goto 90
if f=7 and (g<>11 and g<>14) then goto 90
if f=10 and (g<>4 and g<>12) then goto 90
if f=11 and (g<>15 and g<>18) then goto 90
if f=12 and (g<>13 and g<>14) then goto 90
if f=13 and (g<>12 and g<>17) then goto 90
if f=14 and (g<>7 and g<>16) then goto 90
if f=16 and (g<>17 and g<>18) then goto 90
if f=17 and (g<>16 and g<>20) then goto 90
if f=18 and (g<>11 and g<>19) then goto 90
if f=19 and (g<>20 and g<>21) then goto 90
if f=20 and g<>19 then goto 90
if g=15 then let s3=s3+1
for h=7 to 21
if h=a or h=b or h=c or h=d or h=e or h=f or h=g or h=8 or h=9 or h=10 or h=12 then goto 80
if g=4 and (h<>7 and h<>10) then goto 80
if g=7 and (h<>11 and h<>14) then goto 80
if g=11 and (h<>15 and h<>18) then goto 80
if g=12 and (h<>13 and h<>14) then goto 80
if g=13 and (h<>12 and h<>17) then goto 80
if g=14 and (h<>7 and h<>16) then goto 80
if g=16 and (h<>17 and h<>18) then goto 80
if g=17 and (h<>16 and h<>20) then goto 80
if g=18 and (h<>11 and h<>19) then goto 80
if g=19 and (h<>20 and h<>21) then goto 80
if g=20 and h<>19 then goto 80
if g=21 and h<>15 then goto 80
if h=15 then let s4=s4+1
for i=7 to 21
if i=a or i=b or i=c or i=d or i=e or i=f or i=g or i=h or i=8 or i=9 or i=10 or i=12 or i=13 then goto 70
if h=7 and (i<>11 and i<>14) then goto 70
if h=11 and (i<>15 and i<>18) then goto 70
if h=13 and (i<>12 and i<>17) then goto 70
if h=14 and (i<>7 and i<>16) then goto 70
if h=16 and (i<>17 and i<>18) then goto 70
if h=17 and (i<>16 and i<>20) then goto 70
if h=18 and (i<>11 and i<>19) then goto 70
if h=19 and (i<>20 and i<>21) then goto 70
if h=20 and i<>19 then goto 70
if h=21 and i<>15 then goto 70
if i=15 then let s5=s5+1
for j=11 to 21
if j=a or j=b or j=c or j=d or j=e or j=f or j=g or j=h or j=i or j=12 or j=13 or j=14 then goto 60
if i=7 and (j<>11 and j<>14) then goto 60
if i=11 and (j<>15 and j<>18) then goto 60
if i=14 and (j<>7 and j<>16) then goto 60
if i=16 and (j<>17 and j<>18) then goto 60
if i=17 and (j<>16 and j<>20) then goto 60
if i=18 and (j<>11 and j<>19) then goto 60
if i=19 and (j<>20 and j<>21) then goto 60
if i=20 and j<>19 then goto 60
if i=21 and j<>15 then goto 60
if j=15 then let s6=s6+1
for k=11 to 21
if k=a or k=b or k=c or k=d or k=e or k=f or k=g or k=h or k=i or k=j or k=12 or k=13 or k=14 or k=16 then goto 50
if j=11 and (k<>15 and k<>18) then goto 50
if j=16 and (k<>17 and k<>18) then goto 50
if j=17 and (k<>16 and k<>20) then goto 50
if j=18 and (k<>11 and k<>19) then goto 50
if j=19 and (k<>20 and k<>21) then goto 50
if j=20 and k<>19 then goto 50
if j=21 and k<>15 then goto 50
if k=15 then let s7=s7+1
for l=11 to 21
if l=a or l=b or l=c or l=d or l=e or l=f or l=g or l=h or l=i or l=j or l=k or l=12 or l=13 or l=14 or l=16 or l=17 or l=18 then goto 40
if k=11 and (l<>15 and l<>18) then goto 40
if k=17 and (l<>16 and l<>20) then goto 40
if k=18 and (l<>11 and l<>19) then goto 40
if k=19 and (l<>20 and l<>21) then goto 40
if k=20 and l<>19 then goto 40
if k=21 and l<>15 then goto 40
if l=15 then let s8=s8+1
for m=15 to 21
if m=a or m=b or m=c or m=d or m=e or m=f or m=g or m=h or m=i or m=j or m=k or m=l or m=16 or m=17 or m=18 or m=20 then goto 30
if l=11 and (m<>15 and m<>18) then goto 30
if l=19 and (m<>20 and m<>21) then goto 30
if l=20 and m<>19 then goto 30
if l=21 and m<>15 then goto 30
if m=15 then let s9=s9+1
for n=15 to 21
if n=a or n=b or n=c or n=d or n=e or n=f or n=g or n=h or n=i or n=j or n=k or n=l or n=m or n=16 or n=17 or n=18 or n=19 or n=20 then goto 20
if m=19 and n<>21 then goto 20
if m=21 and n<>15 then goto 20
if n=15 then let s10=s10+1
for o=15 to 15
if n=21 and o<>15 then goto 10
if o=a or o=b or o=c or o=d or o=e or o=f or o=g or o=h or o=i or o=j or o=k or o=l or o=m or o=n then goto 10
if o=15 then let s11=s11+1
10 next o
20 next n
30 next m
40 next l
50 next k
60 next j
70 next i
80 next h
90 next g
100 next f
110 next e
120 next d
130 next c
140 next b
150 next a
PRINT s1;"+";s2;"+";s3;"+";s4;"+";s5;"+";s6;"+";s7;"+";s8;"+";s9;"+";10;"+";s11;"=";s1+s2+s3+s4+s5+s6+s7+s8+s9+s10+s11
end

f9押して 

1+0+0+5+4+13+20+16+19+10+1=89・・・・・・(答え)
豊川市   8月12日(金) 10:36:25     44962

過去問題一覧へ戻る