APL/APL1.1/Dev1.1/Tableaux/mirroir.c

52 lines
729 B
C
Raw Normal View History

2021-10-12 17:22:38 +02:00
#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;
}