#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
int main(void)
{
long x, n=1, best=0, cnt1, cnt2=0;
for (;;) {
cnt1=0;
for (x=n+1; x<=((long long)n*x)/(x-n); x++) {
if (((long long)n*x)%(x-n) == 0) {
cnt1++;
}
}
if (cnt1 > cnt2) {
cnt2 = cnt1;
best = n;
if (cnt2 > MAX) {
(void)printf("n=%ld\n", n);
break;
}
}
n++;
}
return EXIT_SUCCESS;
}
I get:
Wedit output window build: Thu Apr 16 15:28:10 2009
LEL(INDIRL(ADDRLP(23)), DIVL(MULL(CVIL(INDIRI(VREGP(24))),
INDIRL(ADDRLP(23))), CVIL(SUBI(INDIRI(VREGP(22)), INDIRI(VREGP(24))))))Error
c:\users\colin\mydata\tc\compilererror.c: 12
+ compiler error in _kids--
Bad rule number 0
Error c:\users\colin\mydata\tc\compilererror.c 12 Compiler error (trap).
Stopping compilation
Compilation + link time:0.0 sec, Return code: 1
--
Colin
Apr 16: The expression:
int main(void) { long x=2, n=1, cnt1;
cnt1 = x<=((long long)n*x)/(x-n);
}
provoked a compile time error. Fixed. Thanks to Colin Barker for
reporting this bug.