Wednesday, August 23, 2017

2161 Square Root of 10 URI Problem Solution Only In C#


using System; 

 class Exercise8


    
       
     static void Main()
    
    {
       
    double N=Convert.ToDouble(Console.ReadLine());
   
    double ans=0.0;
   
    for(double i=0;i<N;i++)
    {
        ans=6.0+ans;
        ans=(1.0/ans);
    }
   
    ans+=3.0;
   
    Console.WriteLine(ans.ToString("0.0000000000"));
   
    }
   
}

No comments:

Post a Comment