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
ZOJ4105 Abbreviation相关推荐
- 408. Valid Word Abbreviation有效的单词缩写
[抄题]: Given a non-empty string s and an abbreviation abbr, return whether the string matches with th ...
- 408. Valid Word Abbreviation
题目: Given a non-empty string s and an abbreviation abbr, return whether the string matches with the ...
- 288. Unique Word Abbreviation
题目: An abbreviation of a word follows the form <first letter><number><last letter> ...
- [Swift]LeetCode288. 唯一单词缩写 $ Unique Word Abbreviation
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ➤微信公众号:山青咏芝(shanqingyongzhi) ➤博客园地址:山青咏芝(https://www.cnblog ...
- 288. Unique Word Abbreviation
288. Unique Word Abbreviation 方法1: 方法2: 易错点 An abbreviation of a word follows the form . Below are s ...
- Abbreviation
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4105 题意:删去除第一个字符以外,所有的元音字母 题解:模拟 /* *@A ...
- Zoj 2947——Abbreviation
呵呵哒,一开始觉的很难,是因为题长,以后不能被长题再坑了!后来耐下性子读,才发现就是让比对缩写是否相同,我用字符数组写的,当时还开了二维数组,现在想来,实在是笨,不好意思再贴! 某牛的string代码 ...
- 字符串处理 —— 模拟与暴力
[概述] 在某些题目中,需要对字符串进行处理,不需要很复杂的算法,只需要按照题意进行模拟或暴力枚举即可得出答案. [例题] 1.简单模拟 Minimum Ternary String(CF-1009B ...
- pycharm代码模板设置
pycharm代码模板设置 前言 实现效果 设置步骤 前言 在编写代码的过程中,运用模板可以减少很多重复操作,大大减少工作量. 例如,我想将下文的函数简化为只要输入[qt]两个单词,系统就会自动弹出该 ...
最新文章
- web服务器原理(二)
- 使用nvl就不能groupby了吗_宝妈月子期间真的不能吃酱油、醋、葱姜蒜吗?金牌月嫂教你月子餐调味料使用大全!...
- ELSE 技术周刊(2017.12.25期)
- 什么是“软件架构设计”(推荐)
- Ansible 介绍和架构、特性
- 前端笔记-label标签的for属性
- 索引-python核心技术-pyhui版
- Linux 命令(37)—— free 命令
- 广州仙村中学2021高考成绩查询,仙村中学(增城区)
- 公司IT管理制度——案例分享
- 基于LSM和BLP的IPC进程通信模型
- 全国计算机一级考试题库及答案(2018)
- 全球与中国激光共焦扫描显微镜市场深度研究分析报告
- linux中文本保存的快捷键,liunx中vi快捷键编辑
- 自动化学科前沿讲座作业 基于深度学习的工厂人员监测系统设计
- 图片,视频,文件等非结构化数据存储建议
- java大作穿越arpg_动作与角色扮演完美结合 精品ARPG游戏盘点
- 视频文件顺时针旋转90度
- SAP S4 HANA 安装部署记事七.SAP S4 ON HANA 的部署准备
- 前端 彩票开奖走势图的实现