Exemplo n.º 1
0
        public List<string> Solve(List<Argument> input)
        {
            List<string> results = new List<string>();
            int limit;
            BigInteger result = 0;
            Sequences sequences = new Sequences();

            if (int.TryParse(input.First().Value.ToString(), out limit))
            {
                BigInteger fib = 1;
                for (int i = 1; fib <= limit; i++)
                {
                    if (fib % 2 == 0)
                        result += fib;

                    fib = sequences.GetFibonacciTerm(i);
                }
            }

            results.Add(result.ToString());

            return results;
        } 
Exemplo n.º 2
0
 public void SetUp()
 {
     _target = new Sequences();
 }