1
0
Fork 0

p14: some cleanup

This commit is contained in:
H Hautakoski 2010-07-18 14:23:00 +02:00
parent 296a8b84c3
commit 51117a7a67

10
p14.c
View file

@ -12,15 +12,17 @@
#include <stdio.h>
#include <stdint.h>
#define MAX 1000000
int main() {
/* working variables */
int i, nlen, table[1000000] = {0, 1};
int i, nlen, table[MAX] = {0, 1};
int64_t n;
/* result */
int len = 0, rs = 0;
for(i=2; i < 1000000; i++) {
for(i=2; i < MAX; i++) {
n = i;
nlen = 1;
@ -38,12 +40,12 @@ int main() {
nlen++;
}
table[i] = nlen;
if (nlen > len) {
len = nlen;
rs = i;
}
table[i] = nlen;
}
printf("%i\n", rs);