#include <stdio.h>
#include <stdlib.h>
double r;
double x;
int M=11;
int y,z;
int seed=10000;
int lancioDado(){
r=((double)rand())/((double)(RAND_MAX+(double)(1)));
x=(r*M);
y=(int)x;
z=y+1;
return z;
}
main(){
int i;
srand(seed);
for(i=0;i<50;i++){
int n=lancioDado();
printf("%d\n",n);
}
system("pause");
}
Commenti
Posta un commento