jpp/lab1/zad7/c/main.c

22 lines
601 B
C

#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): ");
if (!r.resultExists)
printf("there's no solution\n");
else
printf("%d, %d\n", r.n, r.m);
return 0;
}