判读条件

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. Python Xcode搭建Python环境以及使用PyCharm CE

    pycharm CE下载   使用教程 1.基础学习网站 2.在Xcode7中搭建python开发环境,这个不行了就试试第二个,我是第二个可以正常输出了,第一个没有输出 3.Python学习-MAC下 ...

  2. Python学习日记:day4

    列表 li=['alex',[1,2,3] ,'wusir','egon','女神','taibai']#列表 l1 = li[0] print(l1)#alex l2 = li[1] print ( ...

  3. 【Zookeeper】源码分析之服务器(五)之ObserverZooKeeperServer

    一.前言 前面分析了FollowerZooKeeperServer,接着分析ObserverZooKeeperServer. 二.ObserverZooKeeperServer源码分析 2.1 类的继 ...

  4. Java I/O---类体系总结

    1.Java I/O常用 (1)File 对文件系统中文件以及文件夹进行封装的对象,可以通过对象的思想来操作文件和文件夹. (2)FileInputStream 从文件系统中的某个文件中获得输入字节: ...

  5. JavaScript连等赋值

    最近探究js原理的过程中遇到了这个挺有趣的问题. 先贴代码: var a = {n:1} a.x = a = {n:2} alert(a.x) //undefined 在弄懂这个之前,我们先普及一个知 ...

  6. 《重新定义公司 - Google 是如何运营的》重点摘录

      赋能:创意时代的组织原则 未来企业的成功之道,是聚集一批聪明的创意精英,营造合适的氛围和支持环境,充分发挥他们的创造力,快速感知用户需求,愉快地创造响应的产品和服务.未来组织的最重要功能,那就是赋 ...

  7. String源码图

    String StringBuffer StringBuilder 均为对字符数组的操作. 实现了不同的接口,导致不同的覆写. 实现了同样的接口,适应不同的场景.

  8. ASP.NET如何通过后台数据库提供的链接播放视频(不使用外置插件)

    1.后台视频数据库: 2.aspx中的关键代码: <asp:DataList ID="DataList2" runat="server" DataKeyF ...

  9. mysql 错误信息

    1 连接MySQL错误:Can't connect to MySQL server (10060) link:>>>  http://blog.csdn.net/testcs_dn/ ...

  10. C#Winform 自定义透明按钮和单窗体模块化实现

    技术看点 WinForm自定义控件的使用 WinForm单窗体应用如何模块化 需求及效果 又来一波 C# GDI自定义控件show .这个控件已经使用几年了,最近找出来重构一下.原来是没有边框的,那么 ...