题意就是讲给出的字符串元音字母去掉,在每个辅音字母前加点,且小写输出。。。注意y也要去掉(以我英语挂科的水平也知道y是辅音字母)。。。

水题。。

直接上代码好了。。。

 1 #include <iostream>
 2 #include <stdio.h>
 3 #include <string.h>
 4 #define MAXN 100+10
 5 using namespace std;
 6 
 7 char s[]={"aeiouAEIOUyY"};
 8 
 9 int main(void)
10 {
11     char a[MAXN];
12     gets(a);
13     for(int i=0; i<strlen(a); i++)
14     {
15         if(strchr(s, a[i])==NULL)
16         {
17             if(a[i]<'a')  a[i]+=32;
18             cout << ".";
19             cout << a[i];
20         }
21     }
22     cout << endl;
23     return 0;
24 }

 

相关文章:

  • 2021-05-30
  • 2021-10-31
  • 2021-10-16
  • 2021-07-27
  • 2021-10-28
  • 2022-01-22
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2021-08-10
  • 2022-01-01
  • 2021-07-05
  • 2022-01-11
  • 2021-12-02
相关资源
相似解决方案