缘由https://bbs.csdn.net/topics/395312731
void 查找最多次数(int* a, int aa)
{//缘由https://bbs.csdn.net/topics/395312731
int b = 0, bb = 0, c = 0, d = 0, e = 0;
system("cls");
while (b < aa)
if (bb >= aa)
cout << a[b] << "数找到\t次" << c,
e = d < c ? a[b] : e, d = d < c ? c : d, c = 0, bb = ++b,
Sleep(444), system("cls");
else if (a[b] == a[bb++])
++c;
system("cls"), cout << e << "数最多\t次" << d;
}
int a[] = { 1, 2, 3, 1, 3, 4, 1, 1, 4, 5, 1, 1, 5, 6, 1, 6, 7, 1, 4, 7, 8, 1, 9 };
查找最多次数(a, sizeof(a) / sizeof(a[0]));