>>433 program hoge implicit none integer :: n, r read *, n do r = 1, n print *, n, "C", r, "=", nCr(n,r) end do contains recursive function nCr(n, r) result (c) integer, intent(in) :: n, r integer :: c if (n < 0 .or. r < 0 .or. r > n) then c = 0 else if (n == 0 .or. r == n) then c = 1 else c = nCr(n-1, r-1) + nCr(n-1, r) end if end function nCr end program hoge