Skip to content
Snippets Groups Projects
Commit 15a5d4dc authored by Alexander Camatchy's avatar Alexander Camatchy
Browse files

remodif avant fin du tp

parent 8483d68a
Branches main
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ int f(x) {
return x*x+1;
}
int has_cycle(list_t l, int n) {
int has_cycle(list_t l, int n, unsigned long int *d) {
srand(time(NULL));
l = list_is_empty(l);
int x = rand() % n;
......@@ -33,7 +33,7 @@ int has_cycle(list_t l, int n) {
x = f(x) % n;
int xk;
l = list_push(l, x);
while(gcd(abs(x-f(x)), n) != 1) {
while((*d=gcd(abs(x-f(x)), n)) != 1) {
xk = list_top(l);
l = list_push(l, xk);
l = list_tail(l);
......@@ -41,7 +41,7 @@ int has_cycle(list_t l, int n) {
return 0;
}
// pollard
// rho_pollard
int main() {
// En utilisant l'algorithme rho de Pollard, factorisez les entiers suivants
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment