home *** CD-ROM | disk | FTP | other *** search
- 40 ap=200
- 50 dl=20
- 60 dimb(ap),e(ap),z(ap),gs(ap,dl)
- 80 gosub140
- 90 gosub210
- 100 gosub300
- 110 gosub350
- 120 goto90
- 140 print"[147] disk-optimizer:":print" [197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]":input" summe =";s
- 150 print"bei fehlern '0' eingeben.":print"ende: '999'":print
- 160 az=az+1:print" zahl"az;:inputb(az)
- 170 ifb(az)=0thenaz=az-2:print"[145][145]";:goto160
- 180 ifb(az)<>999goto160
- 190 az=az-1
- 200 print"[147]summe :"s:print"zahlen :";az:return
- 210 v=v+1:print"versuch :"v
- 220 getb$:ifb$="s"thenrun
- 230 fori=1tot:b(z(i))=e(i):next:t=0:bs=0
- 240 z%=rnd(1)*az+1:ifb(z%)=0goto240
- 250 bs=bs+b(z%):t=t+1:e(t)=b(z%):b(z%)=0:z(t)=z%
- 260 ifbs>sgoto210
- 270 ifbs=sthenreturn
- 280 ift=azthenprint"summe aller zahlen ist kleiner als";s:end
- 290 goto240
- 300 g=t-1:forx=gto1step-1
- 310 f=0:fory=1tog:ife(y)<=e(y+1)goto330
- 320 f=y:m=e(y):e(y)=e(y+1):e(y+1)=m
- 330 nexty:g=f:iff=0thenreturn
- 340 nextx:return
- 350 fora=1togs:forb=1tot
- 360 ifgs(a,b)<>e(b)thenb=t:nextb,a:goto380
- 370 nextb:return
- 380 printchr$(19):gs=gs+1:fori=1torz+3:print:next
- 390 fori=1tot:gs(gs,i)=e(i):printe(i);:next
- 400 rz=rz+1:ifrz<20thenreturn
- 410 geta$:ifa$=""goto410
- 420 rz=0:goto200
-