Пример #1
0
            public int Dub(int number)
            {
                var result = number;

                if (number < 0)
                {
                    result = Increment.Inc(result);
                    for (int i = 0; i < number * -1; i++)
                    {
                        result = Decrement.Dec(result);
                    }
                    result = Decrement.Dec(result);
                }
                else
                {
                    result = Decrement.Dec(result);
                    for (int i = 0; i < number; i++)
                    {
                        result = Increment.Inc(result);
                    }
                    result = Increment.Inc(result);
                }

                return(NumberProcessor.Proc(result));
            }
Пример #2
0
 public int Dec(int number)
 {
     return(NumberProcessor.Proc(Increment.Inc(number) - 2));
 }