Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static double F_Rec(int n, int i, out double res)
- {
- if (n <= 0)
- return res = 0;
- if (i != n)
- return res = Math.Sqrt(i + F_Rec(n, i + 1, out res));
- else return res = Math.Sqrt(n);
- }
- static void Main(string[] args)
- {
- int i = 1;
- double res;
- Console.Write("Введите N: ");
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine(F_Rec(n, i, out res) == 0 ? "Функция не определена" : (n / F_Rec(n, i, out res)).ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement