Skip to content

Instantly share code, notes, and snippets.

@dlozeve
Created October 23, 2023 09:04
Show Gist options
  • Save dlozeve/72b0af948bfcd98ff2d24d6a461b234b to your computer and use it in GitHub Desktop.
Save dlozeve/72b0af948bfcd98ff2d24d6a461b234b to your computer and use it in GitHub Desktop.
#include <stdio.h> /////
#include <stdlib.h> //
double x;t,i,m,j, N=1000000; //////
main(){for( ;j<N;j++){ // //
for(m=9,i=0 ;i<4 ;++i){t=1+ // //
rand()%6;m= t<m?t:m; x //////
+=t;}x-=m;}printf("%f\n",x/N);}
x,i,j,m,N=1000000;main(t){for(j=N;j--;){for(m=9,i=4;i--;)t=1+rand()%6,m=t>m?m:t,x+=t;x-=m;}printf("%f",(float)x/N);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment