Esempio n. 1
0
        public static Arrey operator +(Arrey arr1, int k)
        {
            Arrey arrey = new Arrey(arr1.n);

            for (int i = 0; i < arr1.n; i++)
            {
                arrey[i] = arr1[i] + k;
            }
            return(arrey);
        }
Esempio n. 2
0
        public static Arrey operator +(Arrey arr1, Arrey arr2)
        {
            if (arr1.n != arr2.n)
            {
                throw new Exception("Масиви рiзних розмiрiв.");
            }
            Arrey arrey = new Arrey(arr1.n);

            for (int i = 0; i < arr1.n; i++)
            {
                arrey[i] = arr1[i] + arr2[i];
            }
            return(arrey);
        }