Advertisement
myname0

практикум5

Dec 10th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. static double h;
  2.         static double rec(int n, double x)
  3.         {
  4.             h = 5;        
  5.             double y = x;
  6.             while (n > 0)
  7.             {
  8.                 y = x / (n + y);
  9.                 n--;
  10.                 rec(n, x);
  11.             }
  12.              return y;
  13.         }
  14.         static void Main(string[] args)
  15.         {
  16.             Console.WriteLine("Enter n: ");
  17.             int n = int.Parse(Console.ReadLine());
  18.             Console.WriteLine("Enter x: ");        
  19.             double x = double.Parse(Console.ReadLine());
  20.             double t = x;
  21.             double y = rec(n, x, t);
  22.             Console.WriteLine("Result: {0}", rec(n, x, t));
  23.             Console.WriteLine("Result: ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement