2 a
:array [0..100] of string;
3 v
:array ['A'..'Z'] of longint;
4 b
:array [0..100] of longint;
8 function solve(s
:string):longint;
13 if s
[1] in ['A'..'Z'] then
15 if s
[2]='+' then exit(v
[s
[1]]+v
[s
[3]]);
17 if v
[s
[1]]>v
[s
[3]] then exit(1) else exit(0);
23 procedure goto1(line
:longint);
25 if a
[line
]='STOP' then halt
;
27 v
[a
[line
][1]]:=solve(copy(a
[line
],pos('=',a
[line
])+1,length(a
[line
])))
30 writeln(a
[line
],'=',v
[a
[line
][1]])
36 if solve(a
[line
])=0 then goto1(line
+2);
41 assign(input
,'tbasic.in'); reset(input
);
46 while a
[k
][1]=' ' do delete(a
[k
],1,1);
50 if s
='LET' then b
[k
]:=1
51 else if s
='PRINT' then b
[k
]:=2
52 else if s
='GOTO' then b
[k
]:=3
53 else if s
='IF' then b
[k
]:=4
54 else if s
='STOP' then b
[k
]:=5;
55 while a
[k
][1]=' ' do delete(a
[k
],1,1);