4.0w+
社区成员
一、英文字母
#include<iostream>
using namespace std;
typedef long long ll;
//cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
int main()
{
int n;
cin >> n;
cout << (char)('A' + n - 1);
return 0;
}
二、 单词分析
#include<iostream>
using namespace std;
typedef long long ll;
int b[30];
int main()
{
string s;
cin >> s;
int t = s.size();
for(int i = 0; i < t; i ++ ) b[s[i] - 'a' + 1] ++ ;
int ma = 0;
for(int i = 1; i <= 26; i ++ ) ma = max(ma, b[i]);
for(int i = 1; i <= 26; i ++ )
{
if(ma == b[i])
{
cout << (char)(i + 'a' - 1) << endl << ma;
break;
}
}
return 0;
}