Introduction a l algorithmique Master IC
33 pages
Français

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Introduction a l'algorithmique Master IC

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
33 pages
Français
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Niveau: Supérieur, Master
Introduction a l'algorithmique Master IC V. Berry, M. Huchard, T. Libourel, J.F. Pons 2000-2009

  • instructions conditionnelles

  • resultats produits par l'algorithme vers l'exterieur

  • programmation tres

  • description abstraite de la maniere de resoudre

  • donnees


Sujets

Informations

Publié par
Nombre de lectures 35
Langue Français

Extrait

Introduction
V. Berry,
` a
lalgorithmique
Master IC
M. Huchard, T. Libourel,
2000-2009
J.F.
Pons
Tabledesmati`eres
1Premierse´l´ements3 1.1Introduction`alalgorithmiqueet`alaprogrammation..................3 1.2Pr´esentationdunalgorithme...............................4 1.3 Constantes, variables, types, expressions . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.1 Le typeebe´olon 6 . . . . . . . . . . . . . . . . . . . . . . . . . .(ou logique) . 1.3.2 Le typeentier 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.3 Le type´reel 7. . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 1.3.4 Le typet`acarceer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.5 Le typearect`aceserhcˆanıde. . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 Instructions simples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.1 Affectation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.2 Saisie de valeur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.3 Affichage de valeur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.4 Exemple d’algorithme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2Instructionsdecontrˆole11 2.1 Instructions conditionnelles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.1 Manipuler les conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.2Conditionnelle`aunepossibilite´..........................13 2.1.3Conditionnelle`adeuxpossibilit´es(alternative).................14 2.1.4Conditionnellea`possibilit´esmultiples......................14 2.2Instructionsr´ep´etitives...................................16 2.2.1R´epe´titioncontroˆl´pteur......................16 ee par un com 2.2.2R´epe´titioncontrˆol´eeparunecondition(forme1)................18 2.2.3Re´pe´titioncontrˆole´eparunecondition(forme2)................19 3 Fonctions 20 3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2D´eclarationdunefonction.................................20 3.2.1Entˆete........................................21 3.2.2PartieDe´clarationsdevariablesdunefonction.................21 3.2.3 Partie Instructions d’une fonction . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.4 Partie Appels de fonctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.5Exemplecompletded´eclarationdefonction...................22 3.2.6 Appel de la fonction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.3Ex´ecutiondunefonction..................................22 3.4 Exemple : c’est les J.O. ! ! ! ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.5Modularite´.........................................25
1
4
TableaR´rsivit´e ux - ecu 4.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2D´enitionetsyntaxe.................................... 4.2.1 Fonctions classiques sur les tableaux . . . . . . . . . . . . . . . . . . . . . . . 4.3 Exemples d’utilisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Initialisation d’un tableau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 Inversion d’un tableau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Tri d’un tableau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4Tableauxa`plusieursdimensions............................. 4.4.1D´eclaration..................................... 4.4.2Exemple1:initialisation`aze´roduntableau`adeuxdimensions....... 4.4.3Exemple2:carre´faiblementmagique..................... 4.5 Fonctions ´ ur ives . . . . . rec s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.1D´enition...................... . . . . . . . . . . . . . . . . 4.5.2 Exemple : la fonctionf actorielle(n . . . . . . . . . . . . . . . ) .. . . . . . .
2
26 26 26 27 28 28 28 29 30 30 31 31 31 31 31
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents