问题描述
代码示例
#include <bits/stdc++.h>
using namespace std;
int main(){
char string[1000];
char ch = getchar();
int i = 0;
while(ch != '\n'){
string[i++] = ch;
ch = getchar();
}
char str[1000];
int k = 0;
for(int j = 0; j < i; j++){
if(string[j] == 'a' || string[j] == 'e'
|| string[j] == 'i' || string[j] == 'o'
|| string[j] == 'u' || string[j] == 'A'
|| string[j] == 'E' || string[j] == 'I'
|| string[j] == 'O' || string[j] == 'U'){
}else{
if(string[j] <= 'z' && string[j] >= 'a'){
str[k++] = '.';
str[k++] = string[j] - 32;
}else{
str[k++] = '.';
str[k++] = string[j] + 32;
}
}
}
for(int j = 0; j < k; j++){
cout << str[j];
}
return 0;
}
运行结果