Casio FX-850P Scientific Library 116

5020

Grösster gemeinsamer Teiler, Kleinstes gemeinsames Vielfaches

LIB5020 (553 Bytes)

5 ONERRORGOTO1000
10 MODE8:DIM:c$=CHR$(5):a=1:b=1
20 CLS:PRINT"G.C.M. & L.C.M.  (1áa,b<10‘)";
30 s$="a":z=a:GOSUB700:a=z
40 s$="b":z=b:GOSUB700:b=z:CLS
100 IFb>THENf=b:g=ELSEf=a:g=b
110 h=f-INT(f/g)*g:IFTHENf=g:g=h:GOTO110
200 l=a/g*b:PRINT"G.C.M.=";g;TAB(0);"L.C.M.=";l;:z$=INPUT$(1,@):GOTO20
700 LOCATE0,1:PRINTc$;s$;"=";z;"?";:INPUT@11;z:LOCATE0,0:z=ABSz
730 IFz>=1e10 ORz<1 ORFRACz<>0 THEN700 ELSERETURN
1000 IFERR=1 THENCLS:ONERRORGOTO0
1010 IFERL=700 THENRESUME700
1050 LOCATE0,1:PRINTc$;"not found";:z$=INPUT$(1,@):RESUME20

Generated by (c) Casio FX-850P/FX-880P Notepad 2.02

(c) by mani.becker@web.de - http://blog.manib.bplaced.net