Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algorithmie
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
mathias.catala
Algorithmie
Commits
ed25b40b
Commit
ed25b40b
authored
1 year ago
by
mathias.catala
Browse files
Options
Downloads
Patches
Plain Diff
" commit"
parent
037486ec
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
myTP/TP12/exo1.c
+0
-4
0 additions, 4 deletions
myTP/TP12/exo1.c
myTP/TP13/exo1
+0
-0
0 additions, 0 deletions
myTP/TP13/exo1
myTP/TP13/exo1.c
+9
-23
9 additions, 23 deletions
myTP/TP13/exo1.c
myTP/TP13/exo2.c
+39
-0
39 additions, 0 deletions
myTP/TP13/exo2.c
with
48 additions
and
27 deletions
myTP/TP12/exo1.c
+
0
−
4
View file @
ed25b40b
...
@@ -87,11 +87,7 @@ void dir_print(directory_t *dir,int n){
...
@@ -87,11 +87,7 @@ void dir_print(directory_t *dir,int n){
person_t
t
=
dir
->
content
[
n
];
person_t
t
=
dir
->
content
[
n
];
printf
(
"[%d] "
,
n
);
printf
(
"[%d] "
,
n
);
person_print
(
t
);
person_print
(
t
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
myTP/TP13/exo1
100644 → 100755
+
0
−
0
View file @
ed25b40b
No preview for this file type
This diff is collapsed.
Click to expand it.
myTP/TP13/exo1.c
+
9
−
23
View file @
ed25b40b
...
@@ -9,24 +9,22 @@ void reverse(char [], int, int);
...
@@ -9,24 +9,22 @@ void reverse(char [], int, int);
int
count
(
char
*
str
,
char
c
);
int
count
(
char
*
str
,
char
c
);
int
main
()
int
main
()
{
{
char
str1
[
20
]
=
"salut"
;
char
test_char
=
'a'
;
int
size
;
char
*
str
=
"Salut les amis"
;
char
*
str
=
"Salut les amis
\n
"
;
printf
(
" le nombre de charactère: '%c' dans %s est : %d"
,
test_char
,
str
,
count
(
str
,
test_char
));
size
=
strlen
(
str1
);
reverse
(
str1
,
0
,
size
-
1
);
//reverse(str1, 0, size - 1);
printf
(
"
\n
"
);
reverse_print
(
str
);
reverse_print
(
str
);
printf
(
"Number: %d
\n
"
,
count
(
str
,
'a'
));
printf
(
"The string after reversing is: %s
\n
"
,
str1
);
return
0
;
return
0
;
}
}
void
reverse_print
(
char
*
str
){
void
reverse_print
(
char
*
str
){
if
(
*
str
){
if
(
*
str
){
reverse_print
(
str
+
1
);
reverse_print
(
str
+
1
);
...
@@ -40,18 +38,6 @@ int count(char* str, char c){
...
@@ -40,18 +38,6 @@ int count(char* str, char c){
return
count
(
str
+
1
,
c
)
+
(
*
str
==
c
);
return
count
(
str
+
1
,
c
)
+
(
*
str
==
c
);
}
}
return
0
;
}
}
\ No newline at end of file
void
reverse
(
char
str1
[],
int
index
,
int
size
)
{
char
temp
;
temp
=
str1
[
index
];
str1
[
index
]
=
str1
[
size
-
index
];
str1
[
size
-
index
]
=
temp
;
if
(
index
==
size
/
2
)
{
return
;
}
reverse
(
str1
,
index
+
1
,
size
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
myTP/TP13/exo2.c
0 → 100644
+
39
−
0
View file @
ed25b40b
#include
<stdio.h>
#include
<string.h>
typedef
enum
{
WALL
,
PATH
,
START
,
END
}
maze_part_t
;
typedef
struct
{
maze_part_t
**
data
;
int
n
;
}
maze_t
;
// Affiche un labyrinthe dans le console
void
maze_print
(
maze_t
maze
);
// Cette fonction alloue la mémoire pour un labyrinthe
// Initialise toutes les cases à WALL
maze_t
maze_alloc
(
int
n
);
// Libère la mémoire d'un labyrinthe
// met maze.data à NULL
void
maze_free
(
maze_t
maze
);
void
maze_create
(
maze_t
maze
);
int
main
(){
maze_print
(
maze_t
maze
)
}
void
maze_print
(
maze_t
maze
){
int
size
=
maze
.
n
;
printf
(
"size : %d"
,
maze
.
data
);
}
\ 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