diff --git a/Dev1.1/Tableaux/Max b/Dev1.1/Tableaux/Max new file mode 100755 index 0000000..c2bca35 Binary files /dev/null and b/Dev1.1/Tableaux/Max differ diff --git a/Dev1.1/Tableaux/Maximum.c b/Dev1.1/Tableaux/Maximum.c new file mode 100644 index 0000000..913df73 --- /dev/null +++ b/Dev1.1/Tableaux/Maximum.c @@ -0,0 +1,64 @@ +#include +#include +#include + + + +int main(void){ + srand(time(NULL)); + int i; + int y = 0; + int tab [10]; + int max = 0; + int v; + int j; + int vrai; + while (y<10) { + tab[y] = rand()%101-50; + if (tab[y] > max) { + max = tab[y]; + } + y=y+1; + } + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + for (i=0; i<10; i++){ + printf("|%4d ",tab[i]); + } + printf("|"); + printf("\n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + printf("Le Maximum est : %d\n",max); + printf("\n"); + printf("Entrez une valeur : "); + scanf("%d",&v); + for (j=0;j<=10;j++){ + if (tab[j]== v){ + printf("l'indice minimal de la valeur est : %d\n",j); + vrai = ""; + break; + } + if (j==10){ + vrai = -1; + break; + } + + } + + printf("%d\n",vrai); + + + return EXIT_SUCCESS; + + + +} + + diff --git a/Dev1.1/Tableaux/Mirroir.c b/Dev1.1/Tableaux/Mirroir.c new file mode 100644 index 0000000..0435c77 --- /dev/null +++ b/Dev1.1/Tableaux/Mirroir.c @@ -0,0 +1,64 @@ +#include +#include +#include + + + +int main(void){ + srand(time(NULL)); + int i; + int y = 0; + int w = 0; + int tab [10]; + int max = 0; + int v; + int j; + int vrai; + while (y<10) { + tab[y] = rand()%101-50; + if (tab[y] > max) { + max = tab[y]; + } + y=y+1; + } + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + for (i=0; i<10; i++){ + printf("|%4d ",tab[i]); + } + printf("|"); + printf("\n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); +} + + printf("%d\n",vrai); + printf("Mirroir :\n") + while (w<10) { + tab[w] = rand()%101-50; + w=w+1; + } + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + for (i=9; i<=0; i--){ + printf("|%4d ",tab[i]); + } + printf("|"); + printf("\n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); +} + return EXIT_SUCCESS; +} diff --git a/Dev1.1/Tableaux/Remplissage b/Dev1.1/Tableaux/Remplissage new file mode 100755 index 0000000..deb8e09 Binary files /dev/null and b/Dev1.1/Tableaux/Remplissage differ diff --git a/Dev1.1/Tableaux/Remplissage.c b/Dev1.1/Tableaux/Remplissage.c new file mode 100644 index 0000000..d254531 --- /dev/null +++ b/Dev1.1/Tableaux/Remplissage.c @@ -0,0 +1,34 @@ +#include +#include +#include + + + +int main(void){ +srand(time(NULL)); +int i; +int y = 0; +int tab [10]; +while (y<10) { + tab[y] = rand()%101-50; + y=y+1; +} +for (i=0; i<10; i++){ + printf("+-----"); +} +printf("+"); +printf("\n"); +for (i=0; i<10; i++){ + printf("|%4d ",tab[i]); +} +printf("|"); +printf("\n"); +for (i=0; i<10; i++){ + printf("+-----"); +} +printf("+"); +printf("\n"); + + +return EXIT_SUCCESS; +} diff --git a/Dev1.1/Tableaux/mir b/Dev1.1/Tableaux/mir new file mode 100755 index 0000000..133f673 Binary files /dev/null and b/Dev1.1/Tableaux/mir differ diff --git a/Dev1.1/Tableaux/mirroir.c b/Dev1.1/Tableaux/mirroir.c new file mode 100644 index 0000000..098cd8e --- /dev/null +++ b/Dev1.1/Tableaux/mirroir.c @@ -0,0 +1,51 @@ +#include +#include +#include + + + +int main(void){ + srand(time(NULL)); + int i; + int j; + int y = 0; + int z = 0 ; + int tab [10]; + while (y<10) { + tab[y] = rand()%101-50; + y=y+1; + } + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + for (i=0; i<10; i++){ + printf("|%4d ",tab[i]); + } + printf("|"); + printf("\n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + printf("mirroir ; \n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + for (j=9; j>-1; j--){ + printf("|%4d ",tab[j]); + } + printf("|"); + printf("\n"); + for (i=0; i<10; i++){ + printf("+-----"); + } + printf("+"); + printf("\n"); + return EXIT_SUCCESS; +} + diff --git a/Dev1.1/Tableaux/recherche.c b/Dev1.1/Tableaux/recherche.c new file mode 100644 index 0000000..3d55c39 --- /dev/null +++ b/Dev1.1/Tableaux/recherche.c @@ -0,0 +1,41 @@ +nclude +#include +#include + + + +int main(void){ +srand(time(NULL)); +int i; +int y = 0; +int tab [10]; +int max = 0; +while (y<10) { +tab[y] = rand()%101-50; +if (tab[y] > max) { +max = tab[y]; +} +y=y+1; +} +for (i=0; i<10; i++){ +printf("+-----"); +} +printf("+"); +printf("\n"); +for (i=0; i<10; i++){ +printf("|%4d ",tab[i]); +} +printf("|"); +printf("\n"); +for (i=0; i<10; i++){ +printf("+-----"); +} +printf("+"); +printf("\n"); +printf("Le Maximum est : %d\n",max); + + +return EXIT_SUCCESS; +} + +