Ok so i have this little problem, i have to find all the elements in an array that are duplicates ex:{1,1,1,2,2,3,4,5,6} 1 repeats it self 3 times and 2 two times things like that this is what i have so far...
static void Main(string[] args)
{
int contador = 1,rep=0;
Console.Write("Tamano del arreglo? ");
int n = int.Parse(Console.ReadLine());
Console.WriteLine();
int[] numbers = new int[n];
for (int i = 0; i <= (n - 1); i++) {
Console.WriteLine("Ingresar los valores de arreglo "+i);
numbers[i] = int.Parse(Console.ReadLine());
}
for (int i = 0; i <= (n - 1); i++){
for(int j=0;j<=(i-1);j++){
if(numbers[i] == numbers[j]){
contador++;
rep = numbers[i];
}
}
}
for (int i = 0; i <= (n - 1); i++) {
Console.WriteLine("numbers["+i+"] "+numbers[i]);
}
Console.WriteLine();
if (contador > 1){
Console.WriteLine("Se repitio " + contador + " veces el numero " + rep);
}
}