This commit is contained in:
2025-12-05 13:48:10 +01:00
parent 87565cf26c
commit 1b19a9c052
22 changed files with 2843 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
uint64_t shots_in=0,shots=0;
double x,y;
int main(int argc, char **argv)
{
shots_in = 0;
shots = 0;
for (;;){
x = rand()/(RAND_MAX*1.0);
y = rand()/(RAND_MAX*1.0);
shots ++;
if ((x*x+y*y)<=1){
shots_in ++;
}
}
/* la probabilité vaut tirsIn/tirs,
Elle converge lentement vers pi/4*/
}