From d6fccd8f3766c376a3b8d381754fd66a28d27de3 Mon Sep 17 00:00:00 2001 From: pourchot Date: Wed, 12 Oct 2022 16:41:36 +0200 Subject: [PATCH] 12 Octobre --- .../.nfs00000000008c1c9600000051 | Bin 16712 -> 0 bytes DEV1.1/TP06:Tableaux/filtre.c | 25 +++++++++++++++ DEV1.1/TP06:Tableaux/maximum.c | 22 +++++++++++++ DEV1.1/TP06:Tableaux/miroir.c | 29 ++++++++++++++++++ DEV1.1/TP06:Tableaux/recherche.c | 27 ++++++++++++++++ DEV1.1/TP06:Tableaux/remplissage.c | 16 ++++++++++ 6 files changed, 119 insertions(+) delete mode 100755 DEV1.1/TP05:Boucles/Boucles:suite/Boucles:encore/.nfs00000000008c1c9600000051 create mode 100644 DEV1.1/TP06:Tableaux/filtre.c create mode 100644 DEV1.1/TP06:Tableaux/maximum.c create mode 100644 DEV1.1/TP06:Tableaux/miroir.c create mode 100644 DEV1.1/TP06:Tableaux/recherche.c create mode 100644 DEV1.1/TP06:Tableaux/remplissage.c diff --git a/DEV1.1/TP05:Boucles/Boucles:suite/Boucles:encore/.nfs00000000008c1c9600000051 b/DEV1.1/TP05:Boucles/Boucles:suite/Boucles:encore/.nfs00000000008c1c9600000051 deleted file mode 100755 index 01787a6d83c37191a3d7255d8a794c329813dd3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16712 zcmeHOVQdt~6`u3i*aUnw#ExA^VM9SOZG9MHi~$kuY@fZZ&ftPg(iT{s@7DH~^PPLQ zm)a<_R3=eQjuR@SQj$K*9GC%j-613i4b)$^01Vnh}!S7r{=1T4+2PDC`GBeM`lqUbLT3 z+%DS^)rMMIwnQV1Q7x95Xq;$kZES7vCga{_e&6UHb-VWs@P=Uj60Uf84amr0`Rm%- zb7yXR=a*L}+BejF_thU&e{}C%w51EO|8bfCO{s|X8sJtJ;ny$0H!Z<;Ey2GAyabm$ ztpK7}y*~tAvMYnU1Fj84cn0wfV|ZJcqG-u@c;`+f84ksU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mode 100644 index 0000000..a257f2c --- /dev/null +++ b/DEV1.1/TP06:Tableaux/filtre.c @@ -0,0 +1,25 @@ +#include +#include +#include + +int main() { + int i; + int tab[10]; + srand(time(NULL)); + for (i=0;i<10;i++){ + tab[i]=((rand()%101)-50); + } printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + printf("Voici le tableau sans les valeurs negatives:\n"); + printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + for (i=0;i<10;i++){ + if (tab[i]>0){ + printf("| %3d ",tab[i]); + } else{ + printf("| "); + } + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP06:Tableaux/maximum.c b/DEV1.1/TP06:Tableaux/maximum.c new file mode 100644 index 0000000..c86e021 --- /dev/null +++ b/DEV1.1/TP06:Tableaux/maximum.c @@ -0,0 +1,22 @@ +#include +#include +#include + +int main() { + int i; + int max; + int tab[10]; + srand(time(NULL)); + for (i=0;i<10;i++){ + tab[i]=((rand()%101)-50); + } printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + max=tab[0]; + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + if (max +#include +#include + +int main() { + int i; + int j; + int k; + int tab[10]; + srand(time(NULL)); + for (i=0;i<10;i++){ + tab[i]=((rand()%101)-50); + } printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + printf("Voici le tableaux inverse:\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + i=9; + for(j=0;j<5;j++){ + k=tab[j]; + tab[j]=tab[i]; + tab[i]=k; + i--; + } + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP06:Tableaux/recherche.c b/DEV1.1/TP06:Tableaux/recherche.c new file mode 100644 index 0000000..5c6fd5e --- /dev/null +++ b/DEV1.1/TP06:Tableaux/recherche.c @@ -0,0 +1,27 @@ +#include +#include +#include + +int main() { + int i; + int n; + int m; + int min=-1; + int tab[10]; + srand(time(NULL)); + for (i=0;i<10;i++){ + tab[i]=((rand()%101)-50); + } printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + printf("Veuillez saisir un entier : "); + scanf("%d",&m); + for (i=0;i<10;i++){ + if (tab[i]==m){ + min = i; + break; + } + } printf("Le plus petit indice ou se trouve votre entier est %d .\n",min); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP06:Tableaux/remplissage.c b/DEV1.1/TP06:Tableaux/remplissage.c new file mode 100644 index 0000000..381bec5 --- /dev/null +++ b/DEV1.1/TP06:Tableaux/remplissage.c @@ -0,0 +1,16 @@ +#include +#include +#include + +int main() { + int i; + int tab[10]; + srand(time(NULL)); + for (i=0;i<10;i++){ + tab[i]=((rand()%101)-50); + } printf("+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); + for (i=0;i<10;i++){ + printf("| %3d ",tab[i]); + } printf("|\n+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n"); +return 0; +} \ No newline at end of file