summaryrefslogtreecommitdiffstats
path: root/mat/advent/7/prog.c
diff options
context:
space:
mode:
Diffstat (limited to 'mat/advent/7/prog.c')
-rw-r--r--mat/advent/7/prog.c6
1 files changed, 3 insertions, 3 deletions
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++;
}