分数统计-整数

来源:互联网 发布:硬盘分区数据会丢失吗 编辑:程序博客网 时间:2024/05/01 12:52

这几天被机器学习的复习折腾的死去活来,今儿是在坚持不下去了,回来写写代码,发现竟然完全没有思路了,哼,这才几天没写啊~写了个短的~

/*3-1 int*/#include<stdio.h>#include<string.h>#define MAX 101+10int score[MAX]; int main(){    freopen("data.in","r",stdin);    freopen("data.out","w",stdout);    int n,max=0,i;    memset(score,0,sizeof(score));    while(scanf("%d",&n)==1)    {        score[n]++;        if(score[n]>max)            max = score[n];    }    for(i=0;i<=100;i++)    {        if(score[i]==max)        {            printf("%d\n",i);        }    }    return 0;}

刚开始没读懂题,哎,果然复习影响智商

0 0