I was given an assignment to create a program that solves the Josephus Problem ([URL="http://en.wikipedia.org/wiki/Josephus_problem"]. the program needs to work for n amount of people, and it must use an array.
I need to create a subroutine that will allow the user to read(*,*) n
and create an array that is n big.
integer :: n, i
integer :: array(n)
do i = 1, n
array(i) = 0
end subroutine sub
integer :: size, i
write(*,*) "how big is your array"
end program arrays
I am stuck, and dont know why this isnt working.