

#include <cstdlib>
#include <cmath>
#include <iostream>

int main(int argc, char** argv )
{

	if (argc < 2) return 1;
	
	// how many random numbers shall we generate?
	int how_many = atoi(argv[1]);

	for ( int j = 0; j < how_many; ++j)
	{
		// 'rounds' is a magic constant:
		// take twice this many uniformly distributed random variables,
		// their sum is approximately normal...
		const int rounds = 10;	
		double num = 0;
		for ( int i = 0; i < 2*rounds; ++i )
		{
			// RAND_MAX is the largest possible result of rand()
			num += double(rand()) / RAND_MAX;
		}
		// normalize the sum
		num -= rounds;
		num /= sqrt(rounds);
		// write it out
		std::cout << num << std::endl;
	}

	return 0;
}

