int samples = 100000000; int count = 0; CoLoop(0, samples, [=, &count](int a, int b) { int lcount = 0; while(a < b) { double x = Randomf(); double y = Randomf(); if(sqrt(x*x + y*y) < 1) lcount++; a++; } CoWork::FinLock(); count += lcount; } );
Report message to a moderator