Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            double[] dane = { 10.1, 12.1, 17, 1 };
            Wektor   w    = new Wektor(dane);

            Console.WriteLine("Suma: {0}", w.Suma());
            Console.WriteLine("Średnia: {0}", w.Srednia());
            Console.WriteLine("Max {0}", w.Max());
        }
Exemplo n.º 2
0
        public Wektor Dodaj(Wektor w)
        {
            Wektor suma = new Wektor(this.n);

            for (int i = 0; i < this.dane.Length; i++)
            {
                this.dane[i] += w.GetDane()[i];
            }
            return(suma);
        }
Exemplo n.º 3
0
 public Wektor Utworz()
 {
     {
         Console.WriteLine("Podaj wspolrzedne wektora: ");
         string   wymiar      = Console.ReadLine();
         double[] wspolrzedne = new double[wymiar.Split().Length];
         for (int i = 0; i < wymiar.Length; i++)
         {
             wspolrzedne[i] = double.Parse(wymiar.Split()[i]);
         }
         Wektor nowyWektor = new Wektor(wspolrzedne);
         return(nowyWektor);
     }
 }