Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
suite_fractale2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Baptiste VALLET
suite_fractale2
Commits
8327f5be
Commit
8327f5be
authored
Mar 6, 2023
by
baptiste
Browse files
Options
Downloads
Patches
Plain Diff
Y a pas de commentaires mais c'est parce que j'ai tout supprimé à 14h 50
parents
Branches
master
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+3
-0
3 additions, 0 deletions
.gitignore
makefile
+10
-0
10 additions, 0 deletions
makefile
suiteFractale.cpp
+51
-0
51 additions, 0 deletions
suiteFractale.cpp
with
64 additions
and
0 deletions
.gitignore
0 → 100644
+
3
−
0
View file @
8327f5be
suiteFractale
suiteFractale.o
\ No newline at end of file
This diff is collapsed.
Click to expand it.
makefile
0 → 100644
+
10
−
0
View file @
8327f5be
SRC
=
suiteFractale.cpp
OBJ
=
$(
subst .cpp,.o,
$(
SRC
))
RM
=
rm
-f
suiteFractale
:
$(OBJ)
g++
-o
suiteFractale
$(
OBJ
)
suiteFractale.o
:
suiteFractale.cpp
g++
-c
suiteFractale.cpp
\ No newline at end of file
This diff is collapsed.
Click to expand it.
suiteFractale.cpp
0 → 100644
+
51
−
0
View file @
8327f5be
#include
<iostream>
#include
<vector>
std
::
vector
<
double
>
suiteFractale2
(
int
n
){
std
::
vector
<
double
>
vec
=
std
::
vector
<
double
>
();
double
val
=
0.5
;
double
valAdd
;
double
currVal
;
if
(
n
>=
0
)
vec
.
push_back
(
val
);
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
valAdd
=
val
;
val
*=
0.5
;
currVal
=
val
;
while
(
currVal
<
1
){
vec
.
push_back
(
currVal
);
currVal
+=
valAdd
;
}
}
return
vec
;
}
void
AfficherFractale
(
std
::
vector
<
double
>
vec
){
std
::
cout
<<
std
::
endl
<<
"Fractale : "
;
for
(
auto
d
:
vec
)
std
::
cout
<<
std
::
to_string
(
d
)
<<
" ; "
;
std
::
cout
<<
std
::
endl
;
}
int
main
(){
int
dimension
=
0
;
std
::
vector
<
double
>
vec
=
std
::
vector
<
double
>
();
while
(
dimension
>=
0
){
std
::
cout
<<
"Indiquez la dimension, négatif pour arrêter"
<<
std
::
endl
;
std
::
cin
>>
dimension
;
if
(
dimension
>=
0
){
vec
=
suiteFractale2
(
dimension
);
AfficherFractale
(
vec
);
vec
.
clear
();
}
}
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment