ZOJ4105 Abbreviation

给出一个字符串 要你将里面的a e i y o u删掉并输出 注意!首位不需要删掉(因为没仔细读题差点直接交了

水题 简单模拟就行了
AC代码:

 1 #include<bits/stdc++.h>
 2 #define pi acos(-1)
 3 typedef long long ll;
 4 typedef unsigned long long ull;
 5 using namespace std;
 6 
 7 namespace io {
 8     const int SIZE = 1e7 + 10;
 9     char inbuff[SIZE];
10     char *l, *r;
11     inline void init() {
12         l = inbuff;
13         r = inbuff + fread(inbuff, 1, SIZE, stdin);
14     }
15     inline char gc() {
16         if (l == r) init();
17         return (l != r) ? *(l++) : EOF;
18     }
19     void read(int &x) {
20         x = 0; char ch = gc();
21         while(!isdigit(ch)) ch = gc();
22         while(isdigit(ch)) x = x * 10 + ch - '0', ch = gc();
23     }
24 } using io::read;
25 
26 bool cmp(const int &a, const int &b){
27     return a > b;
28 }
29 
30 int main(){
31     ios::sync_with_stdio(false);
32     int t;
33     cin>>t;
34     string s;
35     while (t--){
36         cin>>s;
37         int len = s.size();
38         cout<<s[0];
39         for (int i = 1; i < len; i++){
40             if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' ||
41                 s[i] == 'y' || s[i] == 'o' || s[i] == 'u')
42                 continue;
43             cout<<s[i];
44         }
45         cout<<endl;
46     }
47     return 0;
48 }

 

转载于:https://www.cnblogs.com/Misuchii/p/10983724.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值