I enter the array, and in the output it outputs the product of the elements to me. (Do not judge strictly, I am a beginner.) How can I output it without changes to the line?

Console.WriteLine("Вводим Вектор"); int k = Convert.ToInt32(Console.ReadLine()); int[] vector = new int[k]; for(x = 0;x < k;x++) { string buff = Console.ReadLine(); vector[x] =int.Parse(Console.ReadLine()); } Console.WriteLine("Наш Вектор"); for(x = 0;x < k;x++) { Console.Write("{0}",vector[x]); } 

    1 answer 1

    Something tells me that you want to write this:

      Console.WriteLine("Вводим кол-во элементов вектора"); int k = int.Parse(Console.ReadLine()); Console.WriteLine("Вводим Вектор"); int[] vector = new int[k]; for (int x = 0; x < k; x++) { vector[x] = int.Parse(Console.ReadLine()); } Console.WriteLine("Наш Вектор"); for (int x = 0; x < k; x++) { Console.Write("{0:N}\n",vector[x]); } Console.ReadKey(); 
    • Now I will try. I just need to find the product of the Vector on the Matrix. - Goldy