I'm trying to make an issue that if equal values will be counted with a single, only I'm not managing to mark as a single value.
#include <stdio.h>
int main(int argc, char** argv)
{
int a, m, i, j, cont = 0;
while(1)
{
scanf("%d %d", &a, &m);
if(a == 0 && m == 0)
break;
int vetor[m], verifica[m];
for(i = 0; i < m; i++)
{
verifica[i] = 0;
}
for(i = 0; i < m; i++)
{
scanf("%d", &vetor[i]);
}
for(i = 0; i < m; i++)
{
for(j = 0; j < m; j++)
{
if(vetor[i] == vetor[j] && verifica[i] != 1 && verifica[j] != 1)
{
cont++;
verifica[i] = 1;
verifica[j] = 1;
}
}
}
printf("%d\n", cont);
}
return 0;
}