Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите число");
            int          n = Convert.ToInt32(Console.ReadLine());
            MyBigInteger result = new MyBigInteger(), num = new MyBigInteger(1);

            for (int i = 1; i <= n; i++)
            {
                num    *= MyBigInteger.generation(new MyBigInteger(i));
                result += num;
            }
            result.print();
        }
Exemplo n.º 2
0
        public static MyBigInteger operator *(MyBigInteger a, MyBigInteger b)//оператор умножение
        //умножение происходит по закону умножение столбиком
        //1-ое число умножем на все числа другого массива
        //со 2-ого умножем на все числа другого массива и результат умножем на 10 по закону умножение столбиком
        {
            MyBigInteger rez = new MyBigInteger(0);

            for (int i = 0; i < b.arr.Count(); i++)
            {
                MyBigInteger newN = a * b.arr[i];
                for (int j = 0; j < i; j++)
                {
                    newN.arr.Insert(0, 0);
                }
                rez += newN;
            }
            return(rez);
        }
Exemplo n.º 3
0
 public static MyBigInteger generation(MyBigInteger a)
 {
     return(a * a);
 }