Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet_Q4_Groupe_O4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lepl1503-2020-groupe-O4
Projet_Q4_Groupe_O4
Commits
ac753b6b
Commit
ac753b6b
authored
Apr 22, 2020
by
Louis Malevez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fonction de factorisation qui prends une liste chainée et écrit l'entier n et ses diviseurs dedans
parent
87d9b5fb
Pipeline
#4637
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
Factor.h
Factor.h
+40
-0
No files found.
Factor.h
0 → 100644
View file @
ac753b6b
//
// Created by Louis Malevez on 22-04-20.
//
#ifndef PROJET_Q4_GROUPE_O4_FACTOR_H
#define PROJET_Q4_GROUPE_O4_FACTOR_H
#include<stdio.h>
#include<stdlib.h>
void
primeFactors
(
struct
dblist
*
l
,
int
n
){
// prends un fichier et écrit un entier et ses diviseurs dans une liste chainée
int
count1
=
0
;
int
count2
=
0
;
PushBack
(
l
,
n
);
while
(
n
%
2
==
0
)
{
if
(
count1
==
0
)
PushBack
(
l
,
2
);
n
=
n
/
2
;
count1
+=
1
;
}
for
(
int
i
=
3
;
i
*
i
<=
n
;
i
=
i
+
2
)
{
while
(
n
%
i
==
0
){
if
(
count2
==
0
)
PushBack
(
l
,
i
);
n
=
n
/
i
;
count2
+=
1
;
}
count2
=
0
;
}
if
(
n
>
2
)
PushBack
(
l
,
n
);
}
#endif //PROJET_Q4_GROUPE_O4_FACTOR_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment