Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jeremy.meissner
cours
Commits
2a2be418
Verified
Commit
2a2be418
authored
1 year ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
maj pour cours 4
parent
dda6a059
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
slides/cours_3.md
+1
-1
1 addition, 1 deletion
slides/cours_3.md
slides/cours_4.md
+13
-7
13 additions, 7 deletions
slides/cours_4.md
with
14 additions
and
8 deletions
slides/cours_3.md
+
1
−
1
View file @
2a2be418
...
...
@@ -307,7 +307,7 @@ Trier un tableau par ordre croissant.
```
C
ind = 0
tant que (ind < SIZE-1)
Trouver le minimum du tableau, tab_min[ind:SIZE].
Trouver le minimum du tableau, tab_min
= min(
[ind:SIZE]
)
.
Échanger tab_min avec tab[ind]
ind += 1
```
...
...
This diff is collapsed.
Click to expand it.
slides/cours_4.md
+
13
−
7
View file @
2a2be418
...
...
@@ -10,9 +10,9 @@ date: "2023-10-10"
. . .
1.
Soit un tableau d'entiers,
`tab[0:SIZE-1]`
et
`i = 0`
.
2.
Trouver l'indice,
`j`
, de
`tab[i:SIZE-
2
]`
où la valeur est minimale.
2.
Trouver l'indice,
`j`
, de
`tab[i:SIZE-
1
]`
où la valeur est minimale.
3.
Échanger
`tab[i]`
et
`tab[j]`
.
4.
`i += 1`
et revenir à 2, tant que
`
j
< SIZE-
2
`
.
4.
`i += 1`
et revenir à 2, tant que
`
i
< SIZE-
1
`
.
# Tri par sélection
...
...
@@ -92,6 +92,8 @@ char name[100] = "Paul is not 100 characters long.";
# Fonctions
\f
ootnotesize
-
Il existe une grande quantités de fonction pour la manipulation de chaînes de caractères dans
`string.h`
.
-
Fonctions principales:
...
...
@@ -265,7 +267,7 @@ int main() {
## Exercice:
*
Réusiner le code se trouvant sur
[
Cyberlearn
](
https://cyberlearn.hes-so.ch/mod
/
resource/
view.php?id=1627712
)
.
[
Cyberlearn
](
https://cyberlearn.hes-so.ch/
pluginfile.php/703384/
mod
_
resource/
content/1/comprendre.c
)
.
# Tableau à deux dimensions (1/4)
...
...
@@ -308,7 +310,11 @@ tab[2][1] = 14; // assignation de 14 à la position 2, 1
# Tableau à deux dimensions (3/4)
## Exercice: déclarer et initialiser aléatoirement un tableau `50x100`
\f
ootnotesize
## Exercice:
Déclarer et initialiser aléatoirement un tableau
`50x100`
avec des valeurs
`0`
à
`255`
. . .
...
...
@@ -513,7 +519,7 @@ $$
while (N >= 0) {
bit = num / 2^N
num = num % 2^N
N
+
= 1
N
-
= 1
}
```
...
...
@@ -772,7 +778,7 @@ struct fraction { // déclaration du type
int32_t num, denom;
}
struct fraction frac; // déclaration de frac
struct fraction frac; // déclaration de
la variable
frac
```
# Types composés: `struct`{.C} (3/6)
...
...
@@ -824,7 +830,7 @@ struct fraction frac; // déclaration de frac
void fraction_init(fraction_t *frac,
int32_t re, int32_t im)
{
// frac a déjà été allouée
//
hypothèse:
frac a déjà été allouée
frac->num = frac;
frac->denom = denom;
}
...
...
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