Добрый день, новичок в программе фортран

. Я хотела бы попросить помочь разобраться с методом Монте-Карло. Необходимо набрать программу на Фортране.
Let

and [a,b] = [0,1]. The true value of Q is

erf(1) = 0.7468241.
Write a Fortran program for implementing

in the following cases:
a) g(x) = 1, which is ‘brute force’ integration, i.e. no importance sampling;
b) g(x) = a exp(- x), where a is a proper normalisation constant.
Tabulate the values of

in each of these two cases, together with their relative differences from the true value Q, as a function of N. What is the reasonable value of N for each case? Which of these two alternatives is to be preferred at relatively low values of N?
Thank you!
Начала я так
For a)
Код:
q=0.7468241 !данное значение
n=100 !number of distribution
iseed=3124356
s=0
do i=1.n
x=rand(iseed)
s=s=exp(-x**2)
end do
s=s/n
r=s/q-1
write(*,*) s,r
end
Правильно ли?