saber quantas vesses X valor aparece no array
Olá, estou com uma dificuldade com o trabalho com arrays(saber quantas vesses o valor X aparece), já pensei um par de coisa, tá dificil
double aux_;
int[] melhor_vendedor = new int[this.atributos.Length];
double melhor_oferta = 0;
for (int x = 0; x < this.atributos.Length; x++)
{
melhor_oferta = this.atributos[x].valor_maximo;
for (int z = 0; z < this.atributos[x].Get_numero_lances(); z++)
{
aux_ = this.atributos[x].Get_lances(z).Valor * this.atributos[x].Peso;
if (aux_ < melhor_oferta & aux_ > this.atributos[x].valor_minimo)
{
melhor_oferta = aux_;
melhor_vendedor[x] = this.atributos[x].Get_lances(z).Efetuador;
}
}
}
pois é, mas dai como eu sei quem levou mais vantagem em cada lance?
não teria um metodo de saber quantos vesses o valor aparece no array?
Discussão (3)
Carregando comentários...