! 9.1.f90 ! 2024-10-09 ! $Id: 9.1.f90 1.1 2024/11/02 14:22:28 s Exp $ program a implicit none integer :: i,n real(8) :: c,eux,ux(7) ! input real(8), dimension(7) :: x=[8d4, 9d4, 10d4, 11d4, 12d4, 13d4, 14d4] n = 7 ! calcurating do i = 1, n ux(i) = u(x(i)) end do eux = sum(ux(1:n)) / n c = eux ** 4 ! output print *,'9.1.f90' print '(a7,7i7)', "x ", int(x(1:n)) print '(a7,7f7.2)', 'U(x)', ux(1:n) print *,"E[U(x)] ", eux print *,"C ",c stop contains real(8) function u(x) implicit none real(8) :: x u = x ** (1.0/4.0) return end function u end program a ! end