#include <iostream>
#include <cstdlib>
#include <ctime>
const int MAX = 10000;
int Prob (int num)
{
   int Cnc = (std::rand() % MAX)+1;
   if (Cnc <= num)
       return 1;
   else
       return 0;
}

int main()
{
    std::srand(std::time(NULL));
    double positives = 0 ;
    for(int n = 0; n < 10000; ++n)
        positives += Prob(5000);
    std::cout << "positives/MAX = " << positives / MAX << '\n';
}
