用c++解决这个问题:所谓众数,就是是一组数据中出现次数最多的数,比如, 3 3 4 4 4 5 6 6 8 8 9 3 3 4 4 4 5 6 6 8 8 9...
以下是使用 C 语言解决这个问题的代码:#include <stdio.h>#include <stdlib.h>#define MAX_N 1010int n, a[MAX_N], b[MAX_N];int main(){scanf("%d", &n);for (int i = 0; i < n; i++)...
·
以下是使用 C 语言解决这个问题的代码:
#include <stdio.h>
#include <stdlib.h>
#define MAX_N 1010
int n, a[MAX_N], b[MAX_N];
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
int x;
scanf("%d", &x);
a[x]++;
}
int max = 0, cnt = 0;
for (int i = 0; i <= 1
更多推荐
所有评论(0)