--- title: "处理字符串" created: 2025-11-28 tags: - 算法 --- # 处理字符串 ## 题目 [处理字符串](https://www.acwing.com/problem/content/description/4218/#) ![[image-f5ae270d.png]] ## 思路分析 根据前面总结 大小写用for+tolower/toupper 查找用find 把元音处理出来 用原串中每个字符在里面匹配 如果找到了元音不输出 如果不是元音 输出.+辅音字符 ## 代码实现 ```cpp #include using namespace std; string s; int main() { cin>>s; string vowel="aeiouy"; for(auto c:s){ c=tolower(c); if(vowel.find(c)==-1) cout<<'.'<