// kadai2-1.cpp
// ex) plot "???.txt" w l
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

//ランダムウォークのステップ数
const int STEPS = 1000;

//0以上1未満の一様乱数を生成する
double frand()
{
	return rand() / (RAND_MAX+1.0);
}

int main()
{
	double	y;
	int	step;

	//乱数を初期化する
	srand((unsigned int)time(NULL));

	//STEPSステップのランダムウォークを実施する
	y = 1.0;
	for (step = 0; step < STEPS; step++) {
		y = y * (0.9 + 0.2 * frand());
		printf("%4.2f\n", y);
	}

	return 0;
}
