Making a smallchange, to make it print in the end as the initial values the actual ones (not the ones divided by the gcd)
Stergios Upload Compile Checker / Explore-Gitea-Actions (push) Successful in 4s
Stergios Upload Compile Checker / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
1 file changed
+8
-6
+8
-6
@@ -106,11 +106,12 @@ static bool bfs(int128_t* sum, int128_t gcd,
|
||||
}
|
||||
|
||||
if (output) {
|
||||
int128_t a = a0 * gcd, b = b0 * gcd, c = c0 * gcd;
|
||||
fprintf(output, "\nSolution found!\n");
|
||||
fprintf(output, "Initial: (");
|
||||
fprint_int128(output, a0); fprintf(output, ", ");
|
||||
fprint_int128(output, b0); fprintf(output, ", ");
|
||||
fprint_int128(output, c0); fprintf(output, ")\n");
|
||||
fprint_int128(output, a); fprintf(output, ", ");
|
||||
fprint_int128(output, b); fprintf(output, ", ");
|
||||
fprint_int128(output, c); fprintf(output, ")\n");
|
||||
|
||||
fprintf(output, "Final: (");
|
||||
fprint_int128(output, found->a); fprintf(output, ", ");
|
||||
@@ -121,10 +122,11 @@ static bool bfs(int128_t* sum, int128_t gcd,
|
||||
}
|
||||
} else if (print_mode == 2) {
|
||||
if (output) {
|
||||
int128_t a = a0 * gcd, b = b0 * gcd, c = c0 * gcd;
|
||||
fprintf(output, "For (");
|
||||
fprint_int128(output, a0); fprintf(output, ", ");
|
||||
fprint_int128(output, b0); fprintf(output, ", ");
|
||||
fprint_int128(output, c0);
|
||||
fprint_int128(output, a); fprintf(output, ", ");
|
||||
fprint_int128(output, b); fprintf(output, ", ");
|
||||
fprint_int128(output, c);
|
||||
fprintf(output, ") the required amount of moves is: %i\n", max_moves);
|
||||
}
|
||||
} else if (print_mode == 3) {
|
||||
|
||||
Reference in new issue
Block a user