2024-03-22 11:44:03 +01:00
|
|
|
#include <wrapper.h>
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
if (argc != 4) {
|
|
|
|
fprintf(stderr, "usage: %s <a> <b> <c>\n", argv[0]);
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
printf("gcd(a, b): %u\n", gcd(atol(argv[1]), atol(argv[2])));
|
|
|
|
printf("factorial(a): %u\n", factorial(atol(argv[1])));
|
|
|
|
Result r = diophantine(atol(argv[1]), atol(argv[2]), atol(argv[3]));
|
2024-03-22 12:43:24 +01:00
|
|
|
printf("diophantine(a, b, c): ");
|
2024-03-22 11:44:03 +01:00
|
|
|
if (!r.resultExists)
|
2024-03-22 12:43:24 +01:00
|
|
|
printf("there's no solution\n");
|
2024-03-22 11:44:03 +01:00
|
|
|
else
|
2024-03-22 12:43:24 +01:00
|
|
|
printf("%d, %d\n", r.n, r.m);
|
2024-03-22 11:44:03 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|