Anonymous user
Proper divisors: Difference between revisions
→{{header|Action!}}
(Added solution for Action!) |
|||
Line 198:
=={{header|Action!}}==
Calculations on a real Atari 8-bit computer take quite long time. It is recommended to use an emulator capable with increasing speed of Atari CPU.
<lang Action!>BYTE FUNC
prod=1 count=0▼
DO▼
count==+1▼
a==/2▼
OD▼
DO▼
OD▼
INT i,max
BYTE count
Line 244 ⟶ 214:
PROC Main()
DEFINE MAXNUM="20000"
INT i,j,count,max,ind
INT ARRAY divisors(100)
BYTE
FOR i=1 TO 10
Line 263 ⟶ 234:
PutE() PrintE("Searching for max number of divisors:")
max=0 ind=0 perc=0 st=range/100▼
▲ DO
▲ FOR i=1 TO range
▲ OD
FOR i=2 TO MAXNUM
DO
FOR i=1 TO MAXNUM
▲ DO
IF count>max THEN
max=count ind=i
|