Witam.
Napisałem kod do obliczania iloczynu skalarnego w C# lecz gdy wysyłam go do zgłoszenia na Spoju wyskakuje mi
"błąd wykonania (NZEC) ". Nie wiem co w tym kodzie jest nie tak. Mogli byście pomoc ?
using System;
namespace zxX
{
class Program
{
public static void Main(string[] args)
{string x;
string y;
int ilosc = int.Parse(Console.ReadLine());
if (ilosc == 0 ) { ilosc = int.Parse(Console.ReadLine()); }
while(ilosc != 0){
x = System.Console.ReadLine();
y = System.Console.ReadLine();
int a = 0;
bool i = false;
string[] liczby = x.Split(' ');
string[] liczby2 = y.Split(' ');
int z = 0;
int suma2 = y.Length - (y.Length / 2);
int suma = x.Length - (x.Length / 2);
while (i != true){
int p = int.Parse(liczby[a]);
int v = int.Parse(liczby2[a]);
z = z + p *v;
if ((a + 1) == suma) {i = true;}
if ((a + 1) == suma2) {i = true;}
a++;}
ilosc--;
System.Console.WriteLine(z) ;
}
}
}
}