Estoy intentando crear un programa que creará un vector, generará 100 números aleatorios (0 - 99) y luego pedirá al usuario ingrese si desean los números ordenados de Alto a Bajo o Bajo a Alto.Usar el tipo genérico 'System.Collections.Generic.List <T>' requiere '1' tipo argumentos
Este es el código que hasta ahora he tratado de hacer funcionar el vector.
using System;
using System.Collections.Generic;
using System.Collections.Generic.List; //this is where the error comes.
using System.Linq;
using System.Text;
namespace System.Collections.Generic
{
class List<T>
{
static void Main(string[] args)
{
List<int> vectorList = new List<int>();
vectorList.Capacity(100);
int i = 100;
for (int x = 0; x <= 100; x++)
{
Random rand = new Random();
i = rand.Next(0, 100);
vectorList.Add(i);
Console.WriteLine(i);
}
}
}
}
Excepto que no tengo idea de cómo solucionar este problema, cualquier ayuda sería muy apreciada.
¿Por qué está redeclarando 'System.Collections.Generic.List'? –
BoltClock
Parece que tiene cierta confusión sobre los diferentes elementos de un programa C#. He intentado abordar algunos de estos en mi respuesta a continuación; Sin embargo, le sugiero que se tome un tiempo para leer sobre los diferentes constructos en el lenguaje C# para que pueda usarlos de manera efectiva y adecuada. – LBushkin