Open main menu

CDOT Wiki β

Changes

GPU610/TeamKappa

44 bytes removed, 22:10, 18 November 2015
Code
ts = steady_clock::now();
//main loop
for (i = 0; i<dart; ++i) {
//get random points
x = (double)generateNumber();
y = (double)generateNumber();
++score;
}
pi = ((double)score / (double)dart)*4.0; // p = 4(m/n)
std::cout << "After " << i << " throws, average pi is " << pi << std::endl;
te = steady_clock::now();
13
edits