static char sccsid
[] = "@(#)factor.c 4.1 (Wollongong) %G%";
* Written to replace factor.s in Bell V7 distribution
sscanf(argv
[1], "%d", &n
);
while (scanf("%d", &n
) == 1)
* Print all prime factors of integer n > 0, smallest first, one to a line
* Return smallest prime factor of integer N > 0
* Algorithm from E.W. Dijkstra (A Discipline of Programming, Chapter 20)
ar
.val
[++ar
.hib
] = x
% y
;
while (ar
.val
[0] != 0 && ar
.hib
> 1) {
ar
.val
[i
] -= j
* ar
.val
[j
];
while (ar
.val
[ar
.hib
] == 0)