#include<iostream>
#include<vector>
using namespace std;
int main()
{
char number[9] = {'1','2','3','4','5','6','7','8','9'};
char arr[100];
int result[10] = {0};
int max=0;
int temp = 0;
cin >> arr;
for (int i=0; i < 100; i++)
{
for (int j = 0; j < 9; j++)
{
if (arr[i] == number[j])
{
result[j + 1]++;
}
}
}
for (int i = 1; i <= 9;i++)
{
if (result[i] > max)
{
max = result[i];
temp = i;
}
else if (result[i] == max)
{
if (temp < i)
{
temp = i;
}
}
}
cout << temp;
}
15번 (0) |
2020.08.28 |
14번 (0) |
2020.08.27 |
12번 (0) |
2020.08.26 |
11번 (0) |
2020.08.26 |
10번 (0) |
2020.08.26 |