Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yassine BAHOU
Projet labyrinthe
Commits
62799ec4
Commit
62799ec4
authored
Jun 23, 2021
by
Wadie EL AMRANI
Browse files
Téléverser un nouveau fichier
parent
9bb797fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
connexe/connexe.c
0 → 100644
View file @
62799ec4
#include "connexe.h"
int
**
matriceadjac
(
int
taille
)
{
int
**
matrice
=
NULL
;
matrice
=
malloc
(
taille
*
sizeof
(
int
*
));
srand
(
time
(
NULL
));
for
(
int
i
=
0
;
i
<
taille
;
i
++
)
{
matrice
[
i
]
=
malloc
(
taille
*
sizeof
(
int
));
}
int
rnd
;
for
(
int
i
=
0
;
i
<
taille
;
i
++
)
{
for
(
int
j
=
0
;
j
<
taille
;
j
++
)
{
matrice
[
i
][
j
]
=
rand
()
%
2
;
matrice
[
j
][
i
]
=
matrice
[
i
][
j
];
}
}
return
matrice
;
}
void
Affichermatrice
(
int
**
matrice
,
int
taille
)
{
for
(
int
i
=
0
;
i
<
taille
;
i
++
)
{
printf
(
"[ "
);
for
(
int
j
=
0
;
j
<
taille
;
j
++
)
{
printf
(
"%d "
,
matrice
[
i
][
j
]);
}
printf
(
"]
\n
"
);
}
}
int
main
(
void
)
{
int
**
m
=
matriceadjac
(
6
);
Affichermatrice
(
m
,
6
);
return
0
;
}
\ No newline at end of file
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