1658: Easier Done Than Said?

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 15  Solved: 12
[Submit][Status][Web Board]

Description

Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember. FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules: It must contain at least one vowel. It cannot contain three consecutive vowels or three consecutive consonants. It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'. (For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other letters are consonants.) Note that these rules are not perfect; there are many common/pronounceable words that are not acceptable.

Input

The input consists of one or more potential passwords, one per line, followed by a line containing only the word 'end' that signals the end of the file. Each password is at least one and at most twenty letters long and consists only of lowercase letters.

Output

For each password, output whether or not it is acceptable, using the precise format shown in the example.

Sample Input

a
tv
ptoui
bontres
zoggax
wiinq
eep
houctuh
end

Sample Output

<a> is acceptable.
<tv> is not acceptable.
<ptoui> is not acceptable.
<bontres> is not acceptable.
<zoggax> is not acceptable.
<wiinq> is not acceptable.
<eep> is acceptable.
<houctuh> is acceptable.
#include<stdio.h>
#include<string.h> int yuanyin(char c)
{
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u') return 1;
return 0;
} int is_yuanyin(char a[])
{
int i,len=strlen(a);
for( i=0; i<len; i++)
if( yuanyin(a[i]) )return 1;
return 0;
} int lianxu(char a[])
{
int i,len = strlen(a);
for(i=0;i<len;i++)
{
if ( i+2 < len && yuanyin(a[i]) && yuanyin(a[i+1]) && yuanyin(a[i+2]))
return 0;
if ( i+2 < len && !yuanyin(a[i]) && !yuanyin(a[i+1]) && !yuanyin(a[i+2]))
return 0;
}
return 1;
} int xiangtong(char a[])
{
int i, len=strlen(a);
for( i=0; i<len ; i++)
{
if(i+1<len && a[i]==a[i+1] && a[i]!='e' && a[i]!='o')
return 0;
}
return 1;
} int main()
{
char a[100];
int len,i;
while(scanf("%s",a)!=EOF){
if( strcmp(a,"end")==0) break;
if(is_yuanyin(a)&&lianxu(a)&&xiangtong(a))
printf("<%s> is acceptable.\n",a);
else
printf("<%s> is not acceptable.\n",a);
} }

  

1658: Easier Done Than Said?的更多相关文章

  1. HBase官方文档

    HBase官方文档 目录 序 1. 入门 1.1. 介绍 1.2. 快速开始 2. Apache HBase (TM)配置 2.1. 基础条件 2.2. HBase 运行模式: 独立和分布式 2.3. ...

  2. UVa(1658),Admiral,海军上将,拆点,MCMF

    题目链接:https://uva.onlinejudge.org/external/16/1658.pdf 题意:求1到N的两条路(不能相交),距离和最小. 分析: 第一次做拆点,有点意思.刚开始一直 ...

  3. OpenJudge/Poj 1658 Eva's Problem

    1.链接地址: http://bailian.openjudge.cn/practice/1658 http://poj.org/problem?id=1658 2.题目: 总时间限制: 1000ms ...

  4. hdu 1039 Easier Done Than Said? 字符串

    Easier Done Than Said?                                                                     Time Limi ...

  5. ural 1356. Something Easier(数论,哥德巴赫猜想)

    1356. Something Easier Time limit: 1.0 secondMemory limit: 64 MB “How do physicists define prime num ...

  6. (转)Is attacking machine learning easier than defending it?

    转自:http://www.cleverhans.io/security/privacy/ml/2017/02/15/why-attacking-machine-learning-is-easier- ...

  7. 遇到 ORACLE 错误 1658

    在对oracle导入数据时,多次报以下错误: IMP-00003: 遇到 ORACLE 错误 1659ORA-01659: 无法分配超出 1 的 MINEXTENTS (在表空间 ZSTA_DATA_ ...

  8. uva 1658 Admiral (最小费最大流)

    uva 1658 Admiral 题目大意:在图中找出两条没有交集的线路,要求这两条线路的费用最小. 解题思路:还是拆点建图的问题. 首先每一个点都要拆成两个点.比如a点拆成a->a'.起点和终 ...

  9. uva 1658 Admiral - 费用流

    vjudge传送门[here] 题目大意:给一个有(3≤v≤1000)个点e(3≤e≤10000)条边的有向加权图,求1~v的两条不相交(除了起点和终点外没有公共点)的路径,使权值和最小. 正解是吧2 ...

随机推荐

  1. 网络编程-TCP连接-readLine

    Server: package com.net.tcp; import java.io.BufferedReader; import java.io.IOException; import java. ...

  2. 萌新笔记之堆(heap)

    前言(萌新感想): 以前用STL的queue啊stack啊priority_queue啊,一直很想懂原理,现在终于课上到了priority_queue,还有就是下周期中考,哈哈,所以写几篇blog总结 ...

  3. 选择Go语言的12个理由

    编者按:多核化和集群化是互联网时代的典型特征,那语言需要哪些特性来应对这些特征呢?多数语言在语法层面并不直接支持协程,而通过库的方式支持的协程的功能也并不完整,比如仅仅提供协程的创建.销毁与切换等能力 ...

  4. [Xcode 实际操作]八、网络与多线程-(21)延时启动画面:使用Thread线程对象的延时方法

    目录:[Swift]Xcode实际操作 本文将演示如何使用线程对象的延时方法,让线程休眠一段时间,暂停动作的执行. 在项目导航区,打开启动画面的故事板[LaunchScreen.storyboard] ...

  5. Mysql相关函数使用和总结(cast、convert)

    一.类型转换 1.获取一个类型的值,并产生另一个类型的值,CAST()和CONVERT()函数. 用法: CAST(value as type); CONVERT(value, type); 解释:C ...

  6. mongodb数据库分片实现链接

    http://www.lanceyan.com/tech/arch/mongodb_shard1.html

  7. Testing Complex Logic with JMeter Beanshell

    BeanShell是最先进的JMeter内置组件之一.JMeter具有丰富的内置插件,可满足性能测试的许多需求.例如,在编写一些复杂的测试时,您可能需要一些额外的脚本.在这种情况下,值得使用Beans ...

  8. python 基础(十二) 图片简单处理

    pillow 图片处理模块 安装 pip install pillow  pip是安装第三方模块的工具 缩放图片实例 from PIL import Image path = r'C:\Users\x ...

  9. 解决 openSUSE 中 Sublime Text 3 的中文显示和输入问题

    测试环境 系统版本:openSUSE Leap 42.2 桌面环境:KDE Plasma 5输入法:fcitx-rime (中州韵) 见周围用 Windows 和 macOS 的小伙伴几乎都在用简单强 ...

  10. mac下启动lnmp的方式

    mac air 系列由于各种原因使得我不得不重启,重启后发现lnmp全部都关闭了, nginx: sudo nginx   php-fpm: sudo php-fpm mysql: cd /usr/l ...