1 10 PRINT "4SQRS"
2 20 PRINT "N = A^2 + B^2 + C^2 + D^2"
3 30 PRINT
4 40 PRINT "N A B C D"
5 50 PRINT"------------------------"
6 60 PRINT
7 70 INPUT M
8 80 LET N=ABSM
9 90 LET R=SQRN
10 100 FOR A = 0 TO R
11 110 LET A2=A*A
12 120 LET N1=N-A2
13 130 FOR B = 0 TO N1
14 140 LET B2=B*B
15 150 LET N2=N1-B2
16 160 FOR C = 0 TO N2
17 170 LET C2 = C*C
18 180 IF A2+B2+C2 > N THEN 270
19 190 LET D = SQRN-A2-B2-C2
20 200 IF D > INTD THEN 260
21 210 IF M>=0 THEN 240
22 220 PRINT " ";-A;-B;-C;-D
23 230 GO TO 60
24 240 PRINT " ";A;B;C;D
25 250 GO TO 60
26 260 NEXT C
27 270 NEXT B
28 280 NEXT A
29 290 GO TO 60
30 300 END