Exemple #1
0
        public string FibonacciJSON(int n)
        {
            log.Info(string.Format("Appel FibonacciJSON - param n = {0}", n));

            try
            {
                var res = JsonConvert.SerializeObject(Mth.CalculateFibonacci(n));

                log.Info(string.Format("Retour FibonacciJSON - resultat = {0}", res));

                return(res);
            }
            catch (Exception e)
            {
                log.Error(string.Format(e.Message));
                return("-1");
            }
        }
Exemple #2
0
        public int Fibonacci(int n)
        {
            log.Info(string.Format("Appel Fibonnacci - param n = {0}", n));

            try
            {
                var res = Mth.CalculateFibonacci(n);

                log.Info(string.Format("Retour Fibonnacci - resultat = {0}", res));

                return(res);
            }
            catch (Exception e)
            {
                log.Error(e.Message);
                return(-1);
            }
        }
Exemple #3
0
 public int Fibonacci(int n)
 {
     return(Mth.CalculateFibonacci(n));
 }