Alonuis
Alonuis
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
had to use a copy u cant otherwise
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
idk now it works
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
it was j=i
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
No description
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
@Pobiega i guess ur dictionary is the only way lol
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
ill explain it
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
can we vc
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
No description
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
int[] arr = { 5, 2, 8, 4, 0, 6, 11, 8, 9, 11, 2, 11 };
int mostrepeat = -999;
int cnt = 0;
int maxcnt = 0;
for (int main = 0; main < 3; main++)
{
if (mostrepeat != -999)
{
Console.WriteLine(mostrepeat);
cnt = 0;
maxcnt = 0;
}


for (int i = 0; i < arr.Length; i++)
{
if (arr[i] == mostrepeat)
continue;

for (int j = i; j < arr.Length; j++)
{
if (arr[j] == arr[i])
{
cnt++;
if (cnt > maxcnt)
{
maxcnt = cnt;
mostrepeat = arr[i];
}
}
}
}
}
int[] arr = { 5, 2, 8, 4, 0, 6, 11, 8, 9, 11, 2, 11 };
int mostrepeat = -999;
int cnt = 0;
int maxcnt = 0;
for (int main = 0; main < 3; main++)
{
if (mostrepeat != -999)
{
Console.WriteLine(mostrepeat);
cnt = 0;
maxcnt = 0;
}


for (int i = 0; i < arr.Length; i++)
{
if (arr[i] == mostrepeat)
continue;

for (int j = i; j < arr.Length; j++)
{
if (arr[j] == arr[i])
{
cnt++;
if (cnt > maxcnt)
{
maxcnt = cnt;
mostrepeat = arr[i];
}
}
}
}
}
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
didnt work
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
oh
43 replies
CC#
Created by Alonuis on 7/25/2024 in #help
can anyone help? i need to print out the 3 most repeated numbers in the array
how'd u add the color
43 replies