Product of divisors: Difference between revisions

→‎{{header|ALGOL 68}}: Added additional translation of the Fortran "sieve" based sample
(+add Pike)
(→‎{{header|ALGOL 68}}: Added additional translation of the Fortran "sieve" based sample)
Line 76:
 
=={{header|ALGOL 68}}==
{{Trans|Fortran}}
<lang algol68>BEGIN # product of divisors - transaltion of the Fortran sample #
[ 1 : 50 ]INT divis;
FOR i TO UPB divis DO divis[ i ] := 1 OD;
FOR i TO UPB divis DO
FOR j FROM i BY i TO UPB divis DO
divis[ j ] *:= i
OD
OD;
FOR i TO UPB divis DO
print( ( whole( divis[ i ], -10 ) ) );
IF i MOD 5 = 0 THEN print( ( newline ) ) FI
OD
END</lang>
{{out}}
<pre>
1 2 3 8 5
36 7 64 27 100
11 1728 13 196 225
1024 17 5832 19 8000
441 484 23 331776 125
676 729 21952 29 810000
31 32768 1089 1156 1225
10077696 37 1444 1521 2560000
41 3111696 43 85184 91125
2116 47 254803968 343 125000
</pre>
 
{{Trans|C++}}
<lang algol68>BEGIN # find the product of the divisors of the first 100 positive integers #
3,026

edits