-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNl.bas
170 lines (141 loc) · 1.9 KB
/
Nl.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
!! Nl by D. G. SCHRAUSSER 2024
!!
INPUT "Dezimalzahl x:",x,27
INPUT "zur Basis S:",s,9
REM FORx=0to100
b=10-s
z1=10*s
z2=100*s
z3=1000*s
z4=10000*s
z5=100000*s
z6=1000000*s
z7=10000000*s
z8=100000000*s
z9=1000000000*s
z10=10000000000*s
z11=100000000000*s
z12=1000000000000*s
z13=10000000000000*s
z14=100000000000000*s
z15=1000000000000000*s
z16=10000000000000000*s
y=INT(x/s)*b
z=x+y
st:
IF z<z1 THEN GOTO st1
IF z>=z1
z=z+10*b
ENDIF
z1=z1+100
GOTO st
st1:
IF z<z2 THEN GOTO st2
IF z>=z2
z=z+100*b
ENDIF
z2=z2+1000
GOTO st1
st2:
IF z<z3 THEN GOTO st3
IF z>=z3
z=z+1000*b
ENDIF
z3=z3+10000
GOTO st2
st3:
IF z<z4 THEN GOTO st4
IF z>=z4
z=z+10000*b
ENDIF
z4=z4+100000
GOTO st3
st4:
IF z<z5 THEN GOTO st5
IF z>=z5
z=z+100000*b
ENDIF
z5=z5+1000000
GOTO st4
st5:
IF z<z6 THEN GOTO st6
IF z>=z6
z=z+1000000*b
ENDIF
z6=z6+10000000
GOTO st5
st6:
IF z<z7 THEN GOTO st7
IF z>=z7
z=z+10000000*b
ENDIF
z7=z7+100000000
GOTO st6
st7:
IF z<z8 THEN GOTO st8
IF z>=z8
z=z+100000000*b
ENDIF
z8=z8+1000000000
GOTO st7
st8:
IF z<z9 THEN GOTO st9
IF z>=z9
z=z+1000000000*b
ENDIF
z9=z9+10000000000
GOTO st8
st9:
IF z<z10 THEN GOTO st10
IF z>=z10
z=z+10000000000*b
ENDIF
z10=z10+100000000000
GOTO st9
st10:
IF z<z11 THEN GOTO st11
IF z>=z11
z=z+100000000000*b
ENDIF
z11=z11+1000000000000
GOTO st10
st11:
IF z<z12 THEN GOTO st12
IF z>=z12
z=z+1000000000000*b
ENDIF
z12=z12+10000000000000
GOTO st11
st12:
IF z<z13 THEN GOTO st13
IF z>=z13
z=z+10000000000000*b
ENDIF
z13=z13+100000000000000
GOTO st12
st13:
IF z<z14 THEN GOTO st14
IF z>=z14
z=z+100000000000000*b
ENDIF
z14=z14+1000000000000000
GOTO st13
st14:
IF z<z15 THEN GOTO st15
IF z>=z15
z=z+1000000000000000*b
ENDIF
z15=z15+10000000000000000
GOTO st14
st15:
IF z<z16 THEN GOTO st16
IF z>=z16
z=z+10000000000000000*b
ENDIF
z16=z16+100000000000000000
GOTO st15
st16:
PRINT FORMAT$("#######",x);" Dl. = ";FORMAT$("##################",z);FORMAT$("#",s);"l."
REM NEXT
END
!!