以0结束的一列整数中的最大数以及这个整数在这列数中出现的次数
#include <stdio.h>
#include <limits.h>
int main() {
int tmax=INT_MIN,max=INT_MIN,count=1;
int a[100],len=0,i;
while(1)
{
scanf("%d",&a[len]);
if(a[len]==0)
{
break;
}
if(max<=a[len])
{
tmax=a[len];
if(tmax==max)
{
count++;
}else
{
count=1;
max=tmax;
}
}
len++;
}
for(i=0;i<len;i++)
{
printf("%d ",a[i]);
}
printf("\n%d %d",count,max);
return 0;
}