解答
       integer s, n, i

c
       read(5,*) n
       s = 0
       do i = 1 , n
          s = s + i
       end do

       write(6,*) 'n = ', n, 'S = ',s

       end