http://codeforces.com/problemset/problem/118/A
生词:
vowel n.元音
consonant n.辅音
corresponding a.对应的
题面:
把一个字符串中的元音字母删除,辅音字母前加上一个‘.’,大写字母转换为小写字母。
使用头文件<cctype>处理。
// codeforces
// 118A
// implementation, string
#include <iostream>
#include <string>
#include <cctype>
#include <set>
using namespace std;
set<char> vowel{ 'a','e','i','o','u','y' };
int main() {
string s;
while (cin >> s) {
int len = (int)s.length();
for (auto &i : s) {
char c = tolower(i);
if (vowel.count(c))
continue;
else
cout << '.' << c;
}
cout << endl;
}
return 0;
}