APL/APL1.1/CMB1/Distribution.c
2021-10-26 17:41:27 +02:00

38 lines
599 B
C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define rangée 4
#define billes 2
int main(void){
int proba = 1/(rangée*2);
int i,j,k,l;
int a[rangée+1] = {};
srand(time(NULL));
int var = rand()%rangée*2+1;
for (i=0;i<=billes-1;i++){
if (var == 1 ){
a[0] = a[0]+1;
}
if (var == rangée*2){
a[rangée-1]=a[var-1]+1;
}
if (var != rangée || var != 1){
if (var%2 != 0){
a[var-1]= a[var-1]+1;
}else{
a[var]=a[var]+1;
}
}
}
for (k=0;k<rangée;k++){
for (l=0;l<a[k];l++){
printf("");
}
printf("\n");
}
return EXIT_SUCCESS;
}