0028 - Mode Value
#include <algorithm> #include <iostream> using namespace std; int number_count[100]={0}; void Slove(int max_count) { for (int i=0; i<100; ++i) if ( max_count == number_count[i] ) cout << i+1 << endl; } int main(void) { int max_count=0, number; while (cin >> number) max_count=max(max_count,++number_count[number-1]); Slove(max_count); return 0; }
やるだけ