fork download
  1. #!/usr/bin/perl
  2. $good=0;
  3. for($i=1;$i<=1000000;$i++)
  4. {
  5. $n=0;
  6. if(rand(100)<=10){$n++};
  7. if(rand(100)<=10){$n++};
  8. if(rand(100)<=10){$n++};
  9. if(rand(100)<=10){$n++};
  10. if ($n>=3) {$good++};
  11. }
  12. print $good/1000000;
Success #stdin #stdout 1.38s 6044KB
stdin
Standard input is empty
stdout
0.003763