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
Louis Malevez
Projet_Q4_Groupe_O4
Commits
6926cfcf
Commit
6926cfcf
authored
Apr 20, 2020
by
Louis Malevez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fonction qui lit et écrit le output
parent
11055c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
prime.c
prime.c
+28
-0
No files found.
prime.c
0 → 100644
View file @
6926cfcf
//
// Created by Louis Malevez on 18-04-20.
//
#include <stdio.h>
#include <stdlib.h>
#include "primeF.h"
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"argv[1]: %s
\n
"
,
argv
[
1
]);
// argv[1] = input file path
printf
(
"argv[2]: %s
\n
"
,
argv
[
2
]);
// argv[2] = output file path
FILE
*
f_in
=
fopen
(
argv
[
1
],
"r"
);
FILE
*
f_out
=
fopen
(
argv
[
2
],
"w"
);
if
(
f_in
==
NULL
)
exit
(
1
);
if
(
f_out
==
NULL
)
exit
(
1
);
int
chiffre
=
0
;
while
(
fscanf
(
f_in
,
"%d"
,
&
chiffre
)
!=
EOF
)
{
// parcours les entiers
primeFactors
(
chiffre
,
f_out
);
// fonction qui écrit un entier et ses diviseurs premiers ds un fichier
}
fclose
(
f_in
);
fclose
(
f_out
);
return
0
;
}
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