| |
|
|
p.specht
| Chinesischer Restsatz ================ One Kleinlaster drives inadvertently whom stall of/ one biederen Bauersfrau circa. The driver is integrally zerknirscht and offer, The zerbrochenen eggs financial To supplant. Unglücklicher point white The Bäuerin not The detailed number, she knows only yet, that they Dreiergruppen counted has, there stayed 2 eggs over, in Fünfergruppen stayed 3 over, therefore has tappt im dunkeln then Siebenerpackungen chosen, but it stayed again 2 eggs over. "Moment: The Gruppengrößen having none joint Teiler - then having we the same." means the driver, consider short and says then: "Ich guilt them money for 23 eggs, and the stood place so did i again on!". How coming it hereon? having it Perhaps already the nachstehende Program?
Windowtitle "Modulo-Kongruenzsystem, here: Chinesischer Restsatz "+\
"With Probiermethode to Prof. Weitz"'(D) demonstration 2017-11 by P.woodpecker, Wien
'Q: https://www.youtube.com/watch?v=0KUDo0Bk : OHNE EACH GEWÄHR!
Windowstyle 24:cls rgb(200,200,255):font 2:declare k&,i&,j&,flg&,n!,X!,w$
Print "\n Wieviele Kongruenzen?: ";:input k&
declare m&[k&],a&[k&],x![k&],n![k&]:print
if k&=3:m&[1]=3:a&[1]=2:m&[2]=5:a&[2]=3:m&[3]=7:a&[3]=2:endif' Schnelltest: x = 23
Whileloop k&:i&=&Loop: hoppla:
Print " ";i&;". Kongruenz: Module?: ";:input w$:case (k&=3) and (w$=""):break
if w$="":locate %csrlin-1,1:sound 80,50:goto "hoppla":endif
m&[i&]=val(w$):locate %csrlin-1,40:Print " remainder?: ";::input w$:a&[i&]=val(w$)
endwhile
n!=1:whileloop k&:i&=&Loop:n!=n!*m&[i&]:endwhile
:whileloop k&:i&=&Loop:x![i&]=n!/m&[i&]:endwhile
whileloop k&:i&=&Loop:flg&=1
whileloop m&[i&]-1:j&=&Loop
ifnot (j&*x![i&]-1) mod m&[i&]:n![i&]=j&:flg&=0:break:endif
endwhile
if flg&:print "\n *** Error: Module ";m&[i&];" not berechenbar! ***"
sound 200,200:waitinput:end:endif
endwhile
X!=0:whileloop k&:i&=&Loop:x!=x!+a&[i&]*x![i&]*n![i&]:endwhile
x!=x! mod n!'Normierte Solution spend:
print "\n Result: X = ";stature$("%g",x!);" \n\n Probe: \n"
whileloop k&:i&=&Loop
print " ":locate %csrlin-1,2
print stature$("%g",x!);" mod ";m&[i&];" = ";tab(20);stature$("%g",x! mod m&[i&]);" "
endwhile:sound 50,50:print "\n OK ?"
waitinput
End
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/25/21 ▲ |
|
|
|