示例#1
0
    static void Main()
    {
        Console.Write("-=-=-=-=-=-=-=-=-=-\nOlá! Vamos somar 2 vetores. \nQuantos elementos eles terão? ");
        int n = Convert.ToInt32(Console.ReadLine());

        OperacaoVetores.somarVetores(OperacaoVetores.montarVetorInt(n), OperacaoVetores.montarVetorInt(n));
    }
示例#2
0
    static void Main()
    {
        OperacaoVetores conta     = new OperacaoVetores();
        Random          aleatorio = new Random();

        int[] array  = new int[10];
        int[] array2 = new int[10];

        /*foreach (int elemento in array){
         * elemento = aleatorio.Next(0, 100);
         * }*/
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = aleatorio.Next(0, 100);
        }

        for (int i = 0; i < array2.Length; i++)
        {
            array2[i] = aleatorio.Next(0, 100);
        }

        conta.somarVetores(array, array2);
    }