This commit is contained in:
Vieira Enzo 2021-10-12 17:22:38 +02:00
parent 63fa82ff5a
commit 5dadaa3828
8 changed files with 254 additions and 0 deletions

BIN
Dev1.1/Tableaux/Max Executable file

Binary file not shown.

64
Dev1.1/Tableaux/Maximum.c Normal file
View File

@ -0,0 +1,64 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
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;
}

64
Dev1.1/Tableaux/Mirroir.c Normal file
View File

@ -0,0 +1,64 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
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;
}

BIN
Dev1.1/Tableaux/Remplissage Executable file

Binary file not shown.

View File

@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
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;
}

BIN
Dev1.1/Tableaux/mir Executable file

Binary file not shown.

51
Dev1.1/Tableaux/mirroir.c Normal file
View File

@ -0,0 +1,51 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
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;
}

View File

@ -0,0 +1,41 @@
nclude <stdio.h>
#include <stdlib.h>
#include <time.h>
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;
}