diff options
author | sijanec <sijanecantonluka@gmail.com> | 2020-12-14 12:43:58 +0100 |
---|---|---|
committer | sijanec <sijanecantonluka@gmail.com> | 2020-12-14 12:43:58 +0100 |
commit | 66ca421a2ce5b16a2f4b8439795e230882773bac (patch) | |
tree | 8576342348826c92f68789ee9c84a194d258e003 /mat | |
parent | advent 7 (diff) | |
download | sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar.gz sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar.bz2 sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar.lz sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar.xz sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.tar.zst sola-gimb-2-66ca421a2ce5b16a2f4b8439795e230882773bac.zip |
Diffstat (limited to 'mat')
-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++; } |