       implicit none   
       real :: no, ro, hi, kak, pi, a, rou, rau ,as
       pi=2.d0*asin(1.d0)
         print *,"角の数を入力して下さい"
          read *,no
         print *,"半径を入力して下さい"
          read *,ro
         print *,"高さを入力して下さい"
          read *,hi

     do kak=1.,31415926.

        a=pi/(acos((2.*hi**2+(2.*ro*(sin(kak*1.d-7*5.d-1)))**2+&
       &(2.*ro*(sin(pi/no+kak*1.d-7*5.d-1)))**2-(2.*ro*(sin(pi/no)))**2)/&
       &(2.*sqrt(((2.*ro*(sin(kak*1.d-7*5.d-1)))**2+hi**2)*&
       &((2.*ro*(sin(pi/no+kak*1.d-7*5.d-1)))**2+hi**2)))))

     if(a>no-1.d-7  .and. a<no+1.d-7) then
         print *,"回転角は：",kak*1.d-7*180/pi

         rou=kak*1.d-7

        as=((sqrt(((2.*ro*(sin(rou/2.)))**2.+hi**2.)*&
        ((2.*ro*(sin(pi/no+rou/2.)))**2.+hi**2.)))/(ro*2.))

        rau=2.*asin((as-sqrt(as**2.-hi**2.))/(ro*2.))


         print *,"折りたたみ角は：",rau*180/pi


           end if
         end do
       end

