#include <iostream>
using namespace std;
int main()
{
char str[100];
cin.get(str, 100);
int ch[26] = { 0 };
int i = 0;
while (str[i] != '\0')
{
if (str[i] >= 'a'&&str[i] <= 'z')
{
int temp = str[i] - 'a';
ch[temp]++;
if (ch[temp] >= 3)
{
printf("%c", 'a' + temp);
break;
}
}
i++;
}
return 1;
}
找出字符串中首先出现3次的字符
最新推荐文章于 2022-04-22 18:07:48 发布