#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
int main(int argc, char *argv[]) {
int
i,a,b,c,t,k,l;
srand(time(NULL));
for(i=0;i<=1000;i++)
{
a=rand()%8;
if(a>3)
t+=1;
}
for(i=0;i<=10000;i++)
b=rand()%8;
if(b>3)
k+=1;
}
for(i=0;i<=100000;i++)
{
c=rand()%8;
if(c>3)
l+=1;
}
printf("1000
atista 4 veya ustu gelme olasiligi binde %d \n ",t);
printf("10000
atista 4 veya ustu gelme olasiligi onbinde %d \n ",k);
printf("100000 atista 4 veya ustu gelme olasiligi yuzbinde %d \n
",l);
system("PAUSE");
return
0;
}
Hiç yorum yok:
Yorum Gönder