I am not able to show the array corresponding to the matrix, just ready the total of bets, but I do not see who corresponds:
I have this method:
static void mostrar(int[,] matriz) //MOSTRAR APUESTAS
{
for (int fila = 0; fila < matriz.GetLength(0); fila++)
{
for (int col = 0; col < matriz.GetLength(1); col++)
{
Console.Write(matriz[fila, col] + "\t");
}
Console.WriteLine();
}
Console.ReadLine();
and here I invoke it:
case 5://VER TODAS LAS APUESTAS
Console.WriteLine("\t\t5 - Ver listado de apuestas: ");
mostrar(matriz);
break;
This is the rest of the code to better understand what the program does, in case 1 load the data:
static void Main(string[] args)
{
string[] nombre;
string[] apellido;
int opcion, tope = 0, cantidad;
bool seguir = true;
Console.WriteLine("\t\t*****Bienvenidos al 5 de Oro*****");
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Ingrese la cantidad de apostantes: ");
cantidad= Convert.ToInt32(Console.ReadLine());
int[] vector = new int[cantidad];
nombre = new string[cantidad];
apellido = new string[cantidad];
int[,] matriz = new int[cantidad, 5];
while (seguir)
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\t\t1-Agregar apuesta");
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\t\t2-Agregar apuesta sorpresa");
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\t\t3-Eliminar Apuesta");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t\t 4-Ver numeros Cliente");
Console.WriteLine("\t\t 5-Ver listado de apuestas");
Console.WriteLine("\t\t 6-Ver numeros sin aciertos");
Console.WriteLine("\t\t7-Salir");
Console.WriteLine();
Console.Write("Ingrese opcion: ");
opcion = Convert.ToInt32(Console.ReadLine());
switch (opcion)
{
case 1:
Console.Clear();
Console.WriteLine("\t\t1 - Agregue una apuesta: ");
if (tope < nombre.Length)
{
Console.Write("Ingrese Nombre: ");
nombre[tope] = Console.ReadLine().ToUpper().Trim();
Console.Write("Ingrese Apellido: ");
apellido[tope] = Console.ReadLine().ToUpper().Trim();
Console.Write("Ingrese su Jugada : ");
cargarjugada(matriz, tope);
agregar(vector, cantidad, ref tope);
}
else
{
Console.WriteLine("No hay mas cupos");
Console.ReadLine();
}
break;