    1 REM消費税を抜いたら幾ら？:PI-5000
   20 ON ERROR GOTO *ERR
   30 ON TOUCH GOSUB *TCH
   40 BREAK OFF:DEFDBL:RANDOMIZE:DEGREE
   50 '
   60 CLS:WIDTH,M,P:WAIT 0
   70 LOCATE 0,0:PRINT "■消費税を抜いたら幾ら？"
   80 LOCATE 32,0:PRINT "[終了]"
   90 CALL@41,(0,0)-(239,15),1,1
  100 TOUCH ON
  110 '
  120 GOTO *SKIP
  130 *RSM
  140 LOCATE 0,4:PRINT "Error:";E$;:CALL @11
  150 *SKIP
  160 CALL@41,(0,16)-(239,168),1,4
  170 W#=A#,X=0,Y=1,N=16,I$="税込み金額=":GOSUB *INUMINP:A#=W#
  180 '消費税の端数切り捨ての場合
  190 G#=(A# + 1#) / 1.05#
  200 L#=A# / 1.05#
  210 ' L# <= n < G#
  220 IF L# = INT(L#) THEN L# = INT(L#) ELSE L#=INT(L#)+1#
  230 G#=INT(G#)
  240 IF L# = G# THEN *ONE
  250 LOCATE 0,2:PRINT "税抜金額 : ";L#;" ～ ";G#;
  260 LOCATE 0,3:PRINT "消費税額 = ";A#-L#;" ～ ";A#-G#;
  270 GOTO *GORYU
  280 *ONE
  290 LOCATE 0,2:PRINT "税抜金額 : "; L# ;
  300 LOCATE 0,3:PRINT "消費税額 : "; A# - L#;
  310 *GORYU
  320 CALL @11
  330 GOTO *SKIP
  340 '
  350 *THEEND
  360 CALL@20:WIDTH,,N:CLS:KEY 0,"":END
  370 '
  380 *TCH
  390 IF TOUCH(32*6,0*15,38*6-1,1*15-1) THEN RETURN *THEEND
  400 RETURN
  410 '
  420 *ERR
  430 IF ERN=20 THEN E$="計算結果あふれ":RESUME *RSM
  440 IF ERN=21 THEN E$="0による除算":RESUME *RSM
  450 IF ERN=22 THEN E$="関数値が範囲外":RESUME *RSM
  460 IF ERN=33 THEN E$="値が範囲外":RESUME *RSM
  470 IF ERN=10 AND ERL=6050 THEN E$="計算式の間違い":RESUME *RSM
  480 WAIT O:PRINT ERN;ERL:CALL@11:END
  490 '
  500 *ILP:LOCATE&4,C:KEY 0,N$+CHR$(&B)+LEFT$(B$,I):INPUT !12,N$
  510 IF TOUCH@Z=N THEN IF TOUCH(&18,&2D,&5F,&3E) THEN I=KLEN(LEFT$(N$,INT(((TOUCH X)-&18)/&6))):GOTO *ILP
  520 RETURN
  530 '
  540 *INUMINP
  550 CALL@41,(X*6,Y*15)-(239,Y*15+15),1,4
  560 W$=STR$(W#):LOCATE X,Y:PRINT I$;:INPUT !N,W$
  570 IF TOUCH@Z=-1 THEN *INUMINP
  580 W# = INT(EVAL(W$))
  590 CALL@41,(X*6,Y*15)-(239,Y*15+15),1,4
  600 LOCATE X,Y:PRINT I$;W#;
  610 RETURN
