判读条件

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. 关于git的一些理论知识

    一.什么是版本控制器 好多刚用git的coder一说起git,就随口会说出版本控制器嘛,我问那是干嘛的,大部分人就回答上传代码的.然后会用,但是有些理论你问他们他们就不知道了,比如不是代码的文件就不能 ...

  2. js变量提升与函数提升

    在es6之前,js语言并没有块级作用域,即{}形成的作用域,只有全局作用域和函数作用域,所谓的提升,即是将该变量的声明或者函数的声明提升,举个例子 console.log(global); //und ...

  3. lesson - 7 vim 详解

    1. vim简介vim是从vi发展出来 ,第一个版本由布莱姆·米勒在1991年发布 ,它基于VIM许可证,兼容GPL. 官网 www.vim.org 2. 安装vim: yum install -y ...

  4. 根据图片的路径(绝对路径/相对路径都可以),生成base64的

    根据图片的路径(绝对路径/相对路径都可以),生成base64的 <!DOCTYPE html> <html> <head> <meta charset=&qu ...

  5. idea激活网站地址,亲测可用(windows7,idea 2016)

    help-register-license server,然后输入 http://idea.iteblog.com/key.php

  6. php 简单通用的日志记录方法

    使用file_put_contents 方法来实现简单便捷的日志记录功能 方法1: // use \r\n for new line on windows, just \n on linux func ...

  7. Hyper-V 虚拟网络设置

    目标:搭建一个主机上的网络用来链接主机和虚拟机,并且虚拟机可以通过主机上网. 步骤一:创建一个Internal Network. 步骤二: 创建虚拟机并设置Virtual Switch. 步骤三:将上 ...

  8. SEO的基本概念 和 提交SITEMAP到搜索引擎

    SEO的基本概念 SEO的基本概念 :我们接触的SEO主要就是做搜索引擎的优化,让搜索引擎更好地收录 我们的网站,不管是首页还是内页,都能有很好的收录和排名.那么我们经常用到的SEO的语句是什么呢?小 ...

  9. canvas 简易的加载进度条

    做一个web app,想在第一次或者更新的时候,有一个更新进度条,我个人比较喜欢圆的那种. canvas + svg高低配,应该还不错的.顺便一提,canvas用来压缩图片也是么么哒的. 先看下效果图 ...

  10. IOS10.3上传照片只能拍照不能选择解决办法

    升级IOS10.3正式版以后可能会出现上传文件的控件只能拍照而不能选择现有图片的问题. 正好被我们碰到了,于是找了找解决思路,发现如下解决思路: 原代码为: <input type=" ...