判读条件

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. nginx编译参数的内容

    最近公司安排我安装几台云服务器环境 采用nginx做反向代理: 查了一下官方文档,参数比较多,很多在上线后 可能才知道注意一下的. 编译安装nginx的话 需要安装一些前置组件: 1.gcc环境:用于 ...

  2. Memcached的简介和使用

    缘起: 在数据驱动的web开发中,经常要重复从数据库中取出相同的数据,这种重复极大的增加了数据库负载.缓存是解决这个问题的好办法.但是ASP.NET中的虽然已经可以实现对页面局部进行缓存,但还是不够灵 ...

  3. Spring拦截器总结

    本文是对慕课网上"搞定SSM开发"路径的系列课程的总结,详细的项目文档和课程总结放在github上了.点击查看 Spring过滤器WebFilter可以配置中文过滤 拦截器实现步骤 ...

  4. scala-Future和Promise

    首先说明同步与异步,阻塞与非阻塞的问题: Asynchronous vs. Synchronous A method call is considered synchronous if the cal ...

  5. DeepLearning.ai学习笔记(三)结构化机器学习项目--week2机器学习策略(2)

    一.进行误差分析 很多时候我们发现训练出来的模型有误差后,就会一股脑的想着法子去减少误差.想法固然好,但是有点headlong~ 这节视频中吴大大介绍了一个比较科学的方法,具体的看下面的例子 还是以猫 ...

  6. bzoj 4013: [HNOI2015]实验比较

    Description 小D 被邀请到实验室,做一个跟图片质量评价相关的主观实验.实验用到的图片集一共有 N 张图片,编号为 1 到 N.实验分若干轮进行,在每轮实验中,小 D会被要求观看某两张随机选 ...

  7. ES6 Proxy和Reflect (上)

    Proxy概述 Proxy用于修改某些操作的默认行为,等同于在语言层面做出修改,所以属于一种"元编程"(meta programming),即对编程语言进行编程. Proxy可以理 ...

  8. application19事件 20多少步骤 具体20多少只有微软知道!!!

  9. 【深度学习系列】一起来参加百度 PaddlePaddle AI 大赛吧!

    写这个系列写了两个月了,对paddlepaddle的使用和越来越熟悉,不过一直没找到合适的应用场景.最近百度搞了个AI大赛,据说有四个赛题,现在是第一个----综艺节目精彩片段预测 ,大家可以去检测一 ...

  10. python 嵌套字典比较值,取值

    #取值import types allGuests = {'Alice': {'apples': 5, 'pretzels': {'12':{'beijing':456}}}, 'Bob': {'ha ...