diff options
-rwxr-xr-x | mat/advent/7/a.out | bin | 8432 -> 8432 bytes | |||
-rw-r--r-- | mat/advent/7/prog.c | 6 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mat/advent/7/a.out b/mat/advent/7/a.out Binary files differindex 66f1e58..490d8e4 100755 --- a/mat/advent/7/a.out +++ b/mat/advent/7/a.out diff --git a/mat/advent/7/prog.c b/mat/advent/7/prog.c index 7549d6b..974a390 100644 --- a/mat/advent/7/prog.c +++ b/mat/advent/7/prog.c @@ -16,10 +16,10 @@ int main (int argc, char ** argv) { unsigned long long int r = 0; unsigned long long int s = 0; /* število najdenih in zapiSanih trojk */ for (x = b; x > 0; x--) { - for (y = x; y > 0; y--) { - for (z = y; z > 0; z--) { + for (y = x-1; y > 0; y--) { + for (z = y-1; z > 0; z--) { r++; - /* fprintf(stderr, "sum = %lu\n", x+y+z); */ + /* fprintf(stderr, "%lu, %lu, %lu\n", x, y, z); */ if ((x+y+z) % 3 == 0) { s++; } |