示例#1
0
 public vecto(vecto t2)
 {
     this.n = t2.n;
     this.a = new int[n];
     for (int i = 0; i < n; i++)
     {
         this.a[i] = t2.a[i];
     }
 }
示例#2
0
        public vecto Tich(vecto t2)
        {
            vecto t = new vecto(this.n);

            for (int i = 0; i < n; i++)
            {
                t.a[i] = this.a[i] * t2.a[i];
            }

            return(t);
        }
示例#3
0
        static void Main5()
        {
            vecto t1 = new vecto(4);
            vecto t2 = new vecto(t1);

            Console.WriteLine("Vecto thu 1:");
            t1.Nhap(); Console.WriteLine("Vecto thu 2:"); t2.Nhap();
            Console.WriteLine("Tong 2 vecto la");
            vecto t3 = t1.Tong(t2);

            t3.Hien();
            Console.WriteLine("Hieu 2 vecto la");
            vecto t4 = t1.Hieu(t2);

            t4.Hien();
            Console.WriteLine("tich 2 vecto la");
            vecto t5 = t1.Tich(t2);

            t5.Hien();
            Console.ReadKey();
        }