18 lines
542 B
Plaintext
18 lines
542 B
Plaintext
90 text: pr#0: home
|
|
95 print "Enter a number to find its factors!"
|
|
97 print "(Zero to quit.)"
|
|
100 print: input a: a=abs(a)
|
|
110 print: if not a then print "Bye!";: end
|
|
120 s=2: e=1
|
|
130 n=0: for i=s to e step 2
|
|
150 f=a/i
|
|
160 if int(f)=f then let a=f: n=n+1: goto 150
|
|
170 if n then print i;: s=i: i=e
|
|
180 next
|
|
190 if n>1 then print "^"; n;
|
|
200 if n and a>1 then print " x ";
|
|
210 rem print a;" "; n;" "; i;" "; e;" ";f
|
|
220 s=(s>2)+s+1: n=(s>3)*2+not n
|
|
230 if n<3 and a>1 then e=sqr(a): goto 130
|
|
240 if n=1 or a>1 then print a;
|
|
250 print: goto 100 |