jpp/lab1/zad7/c/main.c

23 lines
601 B
C
Raw Normal View History

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]));
printf("diophantine(a, b, c): ");
2024-03-22 11:44:03 +01:00
if (!r.resultExists)
printf("there's no solution\n");
2024-03-22 11:44:03 +01:00
else
printf("%d, %d\n", r.n, r.m);
2024-03-22 11:44:03 +01:00
return 0;
}