判读条件

1:有元音字母

2:不能三个连续元音或辅音

3.不能连续两个相同的字母,除非ee或oo

 #include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
char word[];
bool panyuan(int id){
if(word[id]=='a'||word[id]=='e'||word[id]=='i'||word[id]=='o'||word[id]=='u') return true;
return false;
}
bool test1(int n){
for(int i = ; i < n; i++){
if(panyuan(i)) return true;
}
return false;
}
bool test2(int n){
int yuan, fu;
yuan = fu = ;
for(int i = ; i < n; i++){
if(panyuan(i)){
yuan++; fu = ;
}
else {
fu++; yuan = ;
}
if(fu>=||yuan>=) return false;
}
return true;
}
bool test3(int n){
for(int i = ; i < n; i++){
if(word[i]==word[i-]){
if(word[i]=='e'||word[i]=='o') continue;
else return false;
}
}
return true;
}
int main()
{
while(~scanf("%s",word))
{
int len = strlen(word);
if(len==&&word[]=='e'&&word[]=='n'&&word[]=='d') return ;
printf("<%s> is ",word);
if(test1(len)&&test2(len)&&test3(len)) {
printf("acceptable.\n");
}
else printf("not acceptable.\n");
}
return ;
}

http://acm.hdu.edu.cn/showproblem.php?pid=1039(水~)的更多相关文章

  1. HDU 4911 http://acm.hdu.edu.cn/showproblem.php?pid=4911(线段树求逆序对)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4911 解题报告: 给出一个长度为n的序列,然后给出一个k,要你求最多做k次相邻的数字交换后,逆序数最少 ...

  2. KMP(http://acm.hdu.edu.cn/showproblem.php?pid=1711)

    http://acm.hdu.edu.cn/showproblem.php?pid=1711 #include<stdio.h> #include<math.h> #inclu ...

  3. HDU-4632 http://acm.hdu.edu.cn/showproblem.php?pid=4632

    http://acm.hdu.edu.cn/showproblem.php?pid=4632 题意: 一个字符串,有多少个subsequence是回文串. 别人的题解: 用dp[i][j]表示这一段里 ...

  4. 待补 http://acm.hdu.edu.cn/showproblem.php?pid=6602

    http://acm.hdu.edu.cn/showproblem.php?pid=6602 终于能够看懂的题解: https://blog.csdn.net/qq_40871466/article/ ...

  5. HDU-1257 导弹拦截系统 http://acm.hdu.edu.cn/showproblem.php?pid=1257

    Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高 ...

  6. http://acm.hdu.edu.cn/showproblem.php?pid=2579

    #include<stdio.h> #include<string.h> #include<queue> #define N 110 int m, n, k, x1 ...

  7. KMP应用http://acm.hdu.edu.cn/showproblem.php?pid=2594

    riemann与marjorie拼接后riemannmarjorie前缀与后缀公共部分为 rie 长度为 3(即next[l] = next[14]的值,l为拼接后的长度)但:aaaa与aa拼接后aa ...

  8. HDU 2544 最短路 http://acm.hdu.edu.cn/showproblem.php?pid=2544

    //代码: //方法1:Dijkstra's Algorithm #include<stdio.h> #include<math.h> #include<string.h ...

  9. HDU1973 http://acm.hdu.edu.cn/showproblem.php?pid=1973

    #include<stdio.h> #include<stdlib.h> #include<string.h> #include<queue> #inc ...

随机推荐

  1. iOS 类似2048、4096小游戏-OC

    大概思路(初步制作,粗工制造):demo 1.Collection 创建cell 2.cell上添加一个view,用来添加手势 3.字典用来存放数据->每次执行StarGame数组接收没有数字的 ...

  2. iOS tableview和 Collection复用机制

    TableView的重用机制,为了做到显示和数据分离, tableView的实现并且不是为每个数据项创建一个tableCell.而是只创建屏幕可显示最大个数的cell,然后重复使用这些cell,对ce ...

  3. 掌握numpy(二)

    目录 掌握numpy(一) 掌握numpy(二) 掌握numpy(三) 掌握numpy(四) 数组的reshape 顾名思义,就是对数组的形状进行改变,比如行变成列,一行变多行等. in place ...

  4. 自定义tab吸顶效果一(原理)

    PS:问题:什么是吸顶,吸顶有什么作用,吸顶怎么使用? 在很多app商城中,介绍软件的时候就会使用吸顶效果, 吸顶有很多作用,一个最简单粗暴的作用就是,让用户知道此刻在浏览哪个模块,并可以选择另外的模 ...

  5. es6 let和const命令(1)

    基本用法 ES新增了let命令,用于声明变量.其用法类似于var,但是所声明的变量只在let命令所在的代码块中有效. for(let i = 0;i<5;i++) {} console.log( ...

  6. 获取数据库时间sql 以及行级锁总结-共享锁-排他锁-死锁

    --TRUNC(date,[fmt]) /TRUNC(number[,decimals])SELECT SYSDATE FROM dual;SELECT TRUNC(SYSDATE) FROM dua ...

  7. JVM 运行时的内存分配

    首先我们必须要知道的是 Java 是跨平台的.而它之所以跨平台就是因为 JVM 不是跨平台的.JVM 建立了 Java 程序和操作系统之间的桥梁,JVM 是用 C 语言编写,而 C 语言不具备跨平台的 ...

  8. C# 调用动态链接库,给游览器写入Cookie

    样例代码: class Program { /// <summary> /// 写 /// </summary> /// <param name="lpszUr ...

  9. 跟我一起学JQuery插件开发教程

    在逛codeproject网站的时候,突然看到一篇文章:How to write plugin in Jquery. 如果对E文好的同学 ,可以看上面的连接.现在我把上面网站的及结合自己的想法写这篇文 ...

  10. Python的变量和常量

    解释器执行Python的过程:   (python3,c:/test.py) 1:启动python解释器(内存中). 2:将c:/test.py内容从硬盘读到内存中(这一步和文本编辑器是一样的). 3 ...