static bool elimino(int[] lista, string[] nombre, string nom, ref int tope)
{
nom = Console.ReadLine()
bool e = false;
for (int i = 0; i < tope; i++)
{
if (nom == nombre[i])
{
for (int j = i; j < tope - 1; j++)
{
lista[j] = lista[j + 1];
nombre[j] = nombre[j + 1];
tope--;
e = true;
i = tope;
}
}
}
return e;
}
That's what I call it:
elimino(vector, nombre, nom, ref tope);
and I have this matrix defined in the main:
cantidad = Convert.ToInt32(Console.ReadLine());
int[] vector = new int[cantidad];
nombre = new string[cantidad];
int[,] matriz = new int[cantidad, 5];
Where quantity is the number of users (names) and 5 each lottery ball
The issue is that user login, delete, but eliminates the user, not your bet, for example if I have 2 users, one a and another b, if I eliminate a, I have the b with the 2 bets, I need to delete the user with bet of a