#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstring>
#include<map>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int N,C;
int MX=0,TM=0;
map<int,int> mp;
while(cin>>N,N)
{
C = ++mp[N];
if( C > TM )
{
TM = C;
MX = N;
}
else if( C == TM && N < MX )
MX = N;
cout<<TM<<' '<<MX<<'\n';
}
return 0;
}
歡迎光臨 竹園論壇 (http://forum.tfcis.org/) | Powered by Discuz! X3.2 |