文章
49
粉丝
90
获赞
9
访问
27.3k
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> abc(26, 0);
string s;
cin >> s;
for (int i = 0; i < n; i++)
{
if (s[i] - 'a' >= 0 && s[i] - 'a' <= 26)
{
abc[s[i] - 'a']++;
}
}
for (int i = 0; i < 26; i++)
{
if ((abc[i] % 5 == 0 || abc[i] % 7 == 0) && (abc[i] != 0))
{
cout << char(i + 'a') << " " << abc[i] << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发