program ln
implicit none
real::x,term,sum=0
integer::n
do
print*,'please input x and n'
read*,x,n
if(x>1.or.x<0.000001) cycle
end do
do
term=(x**n)/n
sum=sum+term
n=n-1
if(n==0) exit
end do
print*,sum
end program ln
program ln
implicit none
real::x,term,sum=0
integer::n
do
print*,'please input x and n'
read*,x,n
if(x>1.or.x<0.000001) then
cycle
else
exit
end if
end do
do
term=(x**n)/n
sum=sum+term
n=n-1
if(n==0) exit
end do
print*,sum
end program ln